Results 1 to 2 of 2

Thread: Combobox question

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jan 2001
    Location
    Worcester, MA
    Posts
    77

    Combobox question

    I have a combobox in my search form that is created dynamically when the page loads, when a user hits the refresh button to get an updated results total I need to have the values they selected to stay selected. This is the code I am using

    Code:
    Dim tlist(20) As String
                    Dim i As Integer
                    tlist = Split(Request(name), ",")
                    For i = 0 To 20
                        f.SelectedIndex = f.Items.Item(tlist(i))
                    Next

    This works great if I only select 1 item, but if I select multiple I get an error. I am using a multi select combobox and thats why I thought I would have to use an array to do it. But I get "Specified argument was out of the range of valid values. Parameter name: 601,1" when I refresh (601,1 being the values I have selected) and it highlights the "Dim tlist(20) as string" line.
    "Find all you need in your mind if you take the time" -DT

  2. #2
    Lively Member
    Join Date
    Oct 2001
    Posts
    122
    Do you actually have 21 items in your list or only 20? If you have only 20, your loop should go from 0 to 19.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width