Combo Box As Criteria For A Query for multiple values

john_gringo

Registered User.
Local time
Tomorrow, 00:24
Joined
Nov 1, 2011
Messages
87
Hi.
I need to use a combo box as criteria for a query.
I manage to do that for one value but what if I need to check for multiple values?
Excample.
Criteria is a number 1, 2, 3, 6 and 12
When i need only one value for excample 1 is fine. What if I need two or three values as criteris (1 Or 2 Or 6)
?

Regards
 
AFAIK it is not possible to use a combo box for multiple selections but you could use a list box for that.
You could then loop through the selections and build the WHERE clause and apply it to your query's SQL statement.
 
AFAIK it is not possible to use a combo box for multiple selections but you could use a list box for that.
You could then loop through the selections and build the WHERE clause and apply it to your query's SQL statement.

I'm not sure if I understand but i made this.
I put a ListBox with the following values:
1
1 Or 2
12
1 Or 3
1 Or 2 Or 4
and the following in my query:
WHERE ((Doctors.Per)=[Forms]![F_Statistika]![List28]));
It works only for 1 and 12
For all the other selection I receive an error message:
This expression is typed incorectly, or is to complex to be evaluated......
:(
 
I have attached an example of how this might be done.
Post back if you need more help.
 

Attachments

Great, seems it work.
I will modify it accordingly and will come back for the results.
Thanks anyway
 

Users who are viewing this thread

Back
Top Bottom