Multi criteria search

MishkaNanook

Registered User.
Local time
Yesterday, 21:11
Joined
Feb 13, 2014
Messages
16
I have an events database with a description field which I would like to be able to search for multi criteria which would be determined by the user. For example, the user might want to search for all events which are Merchant Navy, Dieppe and Vimy related or they may want to search for only Veterans Week related events.

I've tried creating a form with text boxes that the user would put the criteria in and then basing the query on those text boxes using a like statement.

My problem is that I don't know how many criteria the user will be using so I can have too many or too few text boxes. If too few, the user is not getting all of the records that they are looking for. If too many, the user ends up getting all the records in the database as the system uses the bank boxes to bring back all values, so basically all records.

That being said, is there anyway that I can have only one text box where users would enter in as many or as few crietia words seperated either by a , ; space etc., and the system would return all records which contain any of those words.

Any and all help will be greatly appreciated. :banghead:
 
is there anyway that I can have only one text box where users would enter in as many or as few crietia words seperated either by a , ; space

Yes. You would have to do this via VBA not parameters in the query. You would construct a filter based on their input criteria, open the query via DoCmd.OpenQuery (https://msdn.microsoft.com/en-us/library/office/ff192746.aspx) and apply the filter via DoCmd.ApplyFilter (https://msdn.microsoft.com/en-us/library/office/ff197651.aspx?f=255&MSPPError=-2147217396).
 

Users who are viewing this thread

Back
Top Bottom