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

LIKE statement in query criteria

Status
Not open for further replies.

molly

Technical User
Jul 17, 2000
219
US
I have a "Like" statement that almost works for me. But not fully for multiple choices. I want to enter 2 or 3 answers for the same field plus have the option to Hit the enter key for All records. I can only get 1 answer or I can get ALL. so it almost works.

Like ([Enter multiple Product Class ID’s or Enter for ALL ]) & "*"

so if I want product class 18, it correctly filters only 18's. If i hit enter, I get all my records.

but I sometimes want codes 11, 18 and 24. it only gives me 11's. So what am i doing wrong? thanks

 
You can't expect to be able to enter multiple values to compare against single values like that. The best option is to use a multi-select list box on a form. There are some examples of how to use a list box for a criteria in the FAQs of the queries or reports forums.

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top