Results 1 to 5 of 5
  1. #1
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    austin, Texas, USA
    Posts
    1,029
    Thanks
    0
    Thanked 0 Times in 0 Posts

    search on unbound list box (Acc 2003, Off Prof 200

    how can one implement a drop-down to select a name and have that selection highlighted (selected) on the form's unbound listbox? I have a form with two unbound listboxes and a button to allow the user to add a class to a student based on the selections in each listbox, so they are both unbound with respect to the form itself.

    Using a listbox is preferred so the user can view more than one student at a time; i also want to be able to allow the user to add multiple students to a given class, but one bridge at a time. of course, if there's an answer for both, great...

    TIA

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: search on unbound list box (Acc 2003, Off Prof 200

    I don't understand why you want to use a combo box to select an item in a list box - wouldn't it be easier to select the name in the list box itself? Especially if you want to add multi-select capability later on, the extra step of using a combo box seems superfluous (a combo box doesn't have muti-select capability).

  3. #3
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    austin, Texas, USA
    Posts
    1,029
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: search on unbound list box (Acc 2003, Off Prof

    It doesn't have to be a combo-box - what I want to do is allow the user to search in the listbox without having to scroll all over the place. I know this is a bit retarded, especially if multi-select is available -- the user won't be able to see all the selections and may deselect accidentally - but a list box looks nicer than a drop-down/select and seems perfect for selecting multiple people. fortunately, my user is pretty savvy so I am not too worried about 'pilot error' as they say. but a search for the listbox will greatly help.

    I am trying to give a method for assigning multiple people to a given class, and listbox is what i am using right now. I'm not married to it, but in terms of UI I like it.

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: search on unbound list box (Acc 2003, Off Prof

    You can set the Multi Select property of the list box to Simple or Extended.

    If it is set to Simple, clicking an item adds it to the selection or, if it was already selected, removes it from the selection.
    You can type a letter to jump to the first item starting with that letter, then type the letter again to jump to the next item beginning with that letter etc. Pressing Space adds the item to the selection or removes it from the selection.

    If it is set to Extended, you can select items the same way you can in Windows Explorer:
    - Click to select a single item.
    - Click and drag to select a contiguous range.
    - Click and Shift+click to select a contiguous range.
    - Ctrl+click to select and deselect individual non-contiguous items.

    In both situations, you can loop through the ItemsSelected collection of the list box:

    Dim varItm As Variant
    For Each varItem In lstStudents.ItemsSelected
    MsgBox lstStudents.ItemData(varITm)
    Next varItm

    I don't see how you could combine this with a search combo box.

  5. #5
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    austin, Texas, USA
    Posts
    1,029
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: search on unbound list box (Acc 2003, Off Prof

    Oh yeah I forgot you can just type stuff in. that solves all! I may want to do something like allow the user to sort by other columns, but I can re-set the list box with the last name in the first column, find, add, go on... don't even need to implement multi-select, which I didn't want to do anyway...

    thanks!

Posting Permissions

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