Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Determining what was selected from a multiple list box 1

Status
Not open for further replies.

tbiceps

IS-IT--Management
Nov 23, 2005
106
US
I built a query dynamically, that uses a list box to make multiple selections. How do I determine what is selected from the list box. For instance, I have five entries on the list box that a user may make choices from. If the user makes two choices, how do I determine the choices.
 
Have a look at the ItemsSelected property of the ListBox object.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
This line of code works. Utilized within a loop, I'm able to determine the number of selected items.
SelectedCount = ListBoxFieldName.ItemsSelected.Count


This line of code gives me a compile error each time I attempt to use it to determine the actual value.
'SelectedItem = ListBoxFieldName.ItemsSelected.Item

Do you have any further clues? Thanks in advance.
 
Place the cursor inside the ItemsSelected word in your code, press the F1 key and study the examples provided.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Thanks PHV, this answered my question completely! The F1 key will decrease my post, because it explains the concept thoroughly.
 
Another helpful key when in VBE is the F2 one. Try it.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top