View Full Version : using multi-select on a listbox to set query criteria criteria


kom73
10-09-2001, 06:18 PM
can anyone help with this one?

I have created a simple search form using several comboboxes to set my query criteria. But the user must select a value for each box for the query to run - this make a very specific search. My problem is that I would like the user to be able to select all or several options in the combobox to run a more general search.

I have tried doing this using listboxes instead of comboboxes with the miltiselect function set to simple - but it will not run when more than one item is selected in the listbox.

I presume there is something wrong with my query criteria but I dont what - can any body help?!

SteveA
10-10-2001, 03:45 AM
If you are building your query using VBA, you are able to loop through the items in a listbox and check the Selected property. ie

for i = 0 to Me!Listbox.Listcount -1
if Me!Listbox.Selected(i) then
...
end if
next i

If you aren't using VBA, unfortunately I don't know of any way to achieve it.

I hope it helps.
SteveA