troubleshooting Question

specify multiple criteria in a form text box and pass that criteria to a query

Avatar of mriozzo68
mriozzo68Flag for United States of America asked on
Microsoft Access
15 Comments1 Solution340 ViewsLast Modified:
Hi guys,

I've searched the web and cannot seem to find a solution.  I have a form with a text box that I want to allow a user to enter multiple criteria for one field.  I want to them run a query that will pick up the values in this field.  Just to get something to work right now I gave users seven text boxes to allow them to specify up to seven variables.  The query if then using a criteria string like this...

Like Forms!Switchboard!datafield1 or like Forms!Switchboard!datafield2 or like Forms!Switchboard!datafield3 ... etc.

It's inelegant but it works.  But, it does limit the user to only seven values.  There are thousands of possible values so a multi-select listbox won't be efficient.

I originally tried different "" or "'" variations of picking up the criteria but nothing worked.  I was also surprised that setting the criteria to just one of the datafields and then explicitly entering a criteria string as
Like "XX" or like "YY" or like "ZZ"
did not work either.

TIA for your help
Join our community to see this answer!
Unlock 1 Answer and 15 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 15 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros