A query for multiple cjheck box combinations

dftbloke

New member
Local time
Today, 16:45
Joined
Feb 1, 2008
Messages
3
All,

I have a problem building a query using multiple check boxes. The situation is as follows:

I have a database to monitor enquiries which come into a central email account. I have devised a system where several check boxes are used to define the nature of the enquiry. Users can tick any number or none of the options to describe the enquiry.

I would like to create a query where users can search the database based on the check boxes which have been ticked. For example, if users want to search for enquiries where a specific three check boxes have been ticked, I would like all of the records where these three boxes are checked to appear, and so on for all different combinations of check boxes ticked.

I've tried a few methods, including creating a seperate form for the query where users check their search criteria in line with the enquiry form, but I can't link this with the original form.

I hope my description adequetly conveys the problem I have!

Any thoughts would be most welcome.

Rob
:confused:
 
I think you might need to be a little bit more specific in what that nature of your search is.

Remember that if checkboxes are bound to a yes/no field there can be only two states: yes (-1) or no (0).

Say you have ten checkboxes bound to 10 fields, there's either a -1 or a 0 in each of those fields.

Your user checks 3 of those boxes on the search form: do you want the results to be records that have those three boxes checked, and ONLY those three checkboxes checked, or do you want the search to return records that have those three checkboxes checked REGARDLESS of what other boxes are checked?

If the former, then a relatively simple parameter query would work.
If the later, then I think you're going to have learn to create dynamic SQL to build the WHERE clause of your query using vba.
 

Users who are viewing this thread

Back
Top Bottom