S
Secret Squirrel
I'm trying to test out a query filter that I need to build but I can't figure
out how to filter it properly. I'm using some test data with the following
structure:
tblTest
RecID - PK
EmpName - Text
Chk1 - Yes/No
Chk2 - Yes/No
Chk3 - Yes/No
Records:
RecID1
EmpName - John Doe
Chk1 - True
Chk2 - False
Chk3 - True
RecID2
EmpName - Jane Doe
Chk1 - True
Chk2 - True
Chk3 - True
Now on my form I have a listbox that I want to filter employee names with
using 3 unbound checkboxes on my form. The check boxes coincide with the 3
checks in my tblTest. The Listbox is using a qry from the tblTest to run as
my filter. I have all my fields in this query. I have the criteria for the 3
check fields in my query set to [Forms]![frmTest]![check1], etc.
So what I want to happen is when I check 1, 2, and 3 I only want to show
Jane Doe in the listbox since that emp. has a true value in the table for all
3 checks. When I check 1 and 3 and uncheck 2 I want to show Jane Doe and John
Doe in the listbox since Jane Doe has a true value in Checks 1 & 3 and John
Doe has a check in 1 & 3 also but I want to show both. I'm having a hard time
explaining this so I hope I was clear enough. Now I just need help figuring
out how to filter the query properly.
SS
out how to filter it properly. I'm using some test data with the following
structure:
tblTest
RecID - PK
EmpName - Text
Chk1 - Yes/No
Chk2 - Yes/No
Chk3 - Yes/No
Records:
RecID1
EmpName - John Doe
Chk1 - True
Chk2 - False
Chk3 - True
RecID2
EmpName - Jane Doe
Chk1 - True
Chk2 - True
Chk3 - True
Now on my form I have a listbox that I want to filter employee names with
using 3 unbound checkboxes on my form. The check boxes coincide with the 3
checks in my tblTest. The Listbox is using a qry from the tblTest to run as
my filter. I have all my fields in this query. I have the criteria for the 3
check fields in my query set to [Forms]![frmTest]![check1], etc.
So what I want to happen is when I check 1, 2, and 3 I only want to show
Jane Doe in the listbox since that emp. has a true value in the table for all
3 checks. When I check 1 and 3 and uncheck 2 I want to show Jane Doe and John
Doe in the listbox since Jane Doe has a true value in Checks 1 & 3 and John
Doe has a check in 1 & 3 also but I want to show both. I'm having a hard time
explaining this so I hope I was clear enough. Now I just need help figuring
out how to filter the query properly.
SS