multi field query

evanhughes

Registered User.
Local time
Today, 03:02
Joined
Nov 26, 2009
Messages
46
Hi All

Hope you had a great festive season.

I have searched the web for an answer to my problem to no avail so I hope someone out there can help.

My problem is that I have created a query for my register table and have set in the criteria for the reg_no field the following code.

Like "*" & [Enter Search Criteria] & "*"

This works fine but I also need it to search another field as well, the description field.

Have tried a number of ideas I gleaned from google to no avail.

Can any body steer me in the right direction.

Thanks in advance.

Evan
 
Unless I'm missing something, it seems simple. Put a criteria in the description field as well. The same one if you want it searched for the same input, or a different one if something different is to be searched on. Also depending on your needs, you may want it on a different line in query design view (which produces "OR" instead of "AND" in SQL view).
 
Build a form that has a text box "[Enter Search Criteria]". Then have your query use that text box entry in the two different field criteria. See attached example DB.
 

Attachments

Kryst51 suggested using a form but the parameter can just as easily be stated in the Design View without a form. Like "*"&[parameter]&"*" (when prompted for parameter it populates both the Criteria and Or rows.
 

Users who are viewing this thread

Back
Top Bottom