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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

2+ Criterion & listBox

Status
Not open for further replies.

CptTom

Programmer
Jul 16, 2001
117
US
Using a Listbox, how do I allow the user to select multiple criterion. Put simply, Select, CA, NM, ID & ME.

If the user selects "Multiple" then I want the program to basically continue allowing the additions until the user Presses a "Stop" button and the selections be shown below or to the side.

I know how to write the basic code of adding Filter criteria, I just want to know how to do the looping part. Once I have that down, then I could extend it to multiple states & multiple products.

strFilter = strSelection
Do Until ...
strFilter = strFilter & " OR " & strFilter
Loop

Larry
 
Set the MultiSelect property of the list box to True. Once they have finished selecting you can loop round each element of the lstBox.Selected() array of the list box.

HTH

M :)

 
Super! Now, is there a way to move the selections to a separate list box, so that the user can 'unselect'?

Larry
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top