or in query

D

DD

i have a query that the criteria is the [item #]. if this is typed in i
only want the results of this item #. i would also like to have the user
enter ALL to bring up all the item numbers. can this be done in the same
query.

thanks
 
K

Ken Snell \(MVP\)

This may work:

SELECT *
FROM TableName
WHERE [Item #] = [Enter the item number:]
OR "ALL" = [Enter the item number:];
 
K

Klatuu

Assuming you have a text box on a form you are entering either the item
number or ALL, this should do it:

WHERE [item #] LIKE IIF(Forms!FormName!TextBoxName) = "ALL", "*",
Forms!FormName!TextBoxName)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top