Parameter query using "Or"????

krussell

New member
Local time
Today, 13:24
Joined
Jan 10, 2003
Messages
6
I have a simple query that pulls order data. I put in a parameter so the user can choose the state. Works fine. What if I want the user to be able to select mulitple states? When I type in a state then or and then another state it fails. Can somebody please help??
 
Are you using multiple boxes for the parameters or a list box?

If you're using multiple boxes then just do this:

Forms!frmName!txtName Or Forms!frmName!txtName Or etc.
 
I am using 1 text box...can it be done that way?
 
You'll have to change that. Becuase if they're manually typing it in it will have to have the correct syntax and there's no way a user's going to type that correctly. You can use a listbox to make multiple selections but the code you'll have to use is kind of complicated to pass that to the query. I suggest searching this forum for list boxes.
 
I am actually pretty experienced in code...and basically...lets say we want to only look at states on the east coast. The user checks a box called East Coast and when they press the button, the code creates a string that looks like "ME" Or "NC" Or "NY" etc....then I populate the text box with that string. The query is pointed at that text box...but it still won't work. Any suggestions?
 

Users who are viewing this thread

Back
Top Bottom