Query Criteria and Needing More "OR" Fields

darkstar257

Registered User.
Local time
Yesterday, 22:08
Joined
Jan 6, 2011
Messages
77
I'm using John's dynamic multi search code and i'm building the search query part and making the ID the Criteria and the other parameters the OR criteria with:

Code:
Like "*" & [forms]![FRM_SearchMulti]![SrchText] & "*"

I'm suppose to go down one row for each OR added, but what happens when I need more search parameters and i'm out of rows???

criteria.jpg
 
Right click the design grid to add rows.
 
As for me, I think if you are having to put in that many criteria, then I would rather create a function in VBA which would build my SQL and criteria. It can be way more dynamic and it will wind up less complex in the end than a query which might get to the point of Access barfing on itself.
 
I agree with Bob.

A query that searches every field is not very efficient and wastes a lot of time on fields that definitely won't hold the value. The user will have some idea where they are searching and they certainly would not be looking fo a name in a date field as the example you posted is doing.

There are also better alternatives to achieve what you are doing. Simply derive another field by concatenating all the fields then search that field.
 

Users who are viewing this thread

Back
Top Bottom