query with check boxes

Senerie

New member
Local time
Today, 15:46
Joined
Jul 3, 2002
Messages
8
I have a table with a list of contacts. For each contact there are six yes/no options (e.g., member, donor, resident, etc.). I have a check box for each of these options.

I want to be able to select certain criteria, and bring back all the members who satisfy those criteria. For example, find all members who are also residents, or find residents who aren't donors.

I almost have it. I have a form with check boxes for each option, and a query that gets its criteria from the form. However, the check boxes can only be yes or no. For example, if I check "member" and then run the query, it only brings back members who do not have any other boxes checked. What I want it to do is bring back all members, regardless of what other options are check for that member. I hope I've explained this clearly.

I've tried fooling around with the triple state property of the check boxes, but that isn't working.

Thanks.
 
Senerie, I don't think triple state would help you anyway.

I think building the WHERE statements in code may be the simple way to go about it.
 
Try this:

Set the Triple property of the check boxes on the form to Yes, so that each check box on the form will have three options: True, False, Null.


In the query grid, set the Criteria for each Yes/No field like this:-
iif(isnull([forms]![FormName]![CheckBoxName]), [FieldName], [forms]![FormName]![CheckBoxName])

Hope it helps.
 

Users who are viewing this thread

Back
Top Bottom