Note that a checkbox has three states Null (the gray look when form is first opened, etc.), False (a white background), and True (a check).
In your query, what state do you build on? Just True, or all states?
Using 3 check boxes for example
me!chk1=true
me!chk2=False
me!chk3=False
'If only using the true state
dim sWHERE as strng
sWHEREr=""
if me!chk1 = true then sWHERE = "[Staff]=" & -1
if me!chk2 = true then sWHERE = sWHERE &" AND " & "[Member]=" & -1
if me!chk3 = true then sWHERE = sWHERE &" AND " & "[BoardMember]=" & -1
'PICK OFF A LEADING " AND" IF IT EXISTS
IF LEFT(sWHERE,5) = " AND " THEN sWHERE = RIGHT(sWHERE,Len(sWHERE)-5)
'If only using the true & false states
dim sWHERE as strng
sWHEREr=""
if me!chk1 & "" <> "" true then sWHERE = "[Staff]=" & me!ch1
if me!chk2 & "" <> "" then sWHERE = sWHERE &" AND " & "[Member]=" & me!ch2
if me!chk3 & "" <> "" then sWHERE = sWHERE &" AND " & "[BoardMember]=" & me!ch3
'PICK OFF A LEADING " AND" IF IT EXISTS
IF LEFT(sWHERE,5) = " AND " THEN sWHERE = RIGHT(sWHERE,lENsWHERE)-5)
'I doubt that you're all using the Null state
'no code included for that state
'then whichever method is used
if sWHERE & "" <> "" then
strSQL1 = "(whatever) WHERE " & sWHERE
ELSE
strSQL1 = "(whatever)" ' WITHOUT THE FILTERING
END if
In your query, what state do you build on? Just True, or all states?
Using 3 check boxes for example
me!chk1=true
me!chk2=False
me!chk3=False
'If only using the true state
dim sWHERE as strng
sWHEREr=""
if me!chk1 = true then sWHERE = "[Staff]=" & -1
if me!chk2 = true then sWHERE = sWHERE &" AND " & "[Member]=" & -1
if me!chk3 = true then sWHERE = sWHERE &" AND " & "[BoardMember]=" & -1
'PICK OFF A LEADING " AND" IF IT EXISTS
IF LEFT(sWHERE,5) = " AND " THEN sWHERE = RIGHT(sWHERE,Len(sWHERE)-5)
'If only using the true & false states
dim sWHERE as strng
sWHEREr=""
if me!chk1 & "" <> "" true then sWHERE = "[Staff]=" & me!ch1
if me!chk2 & "" <> "" then sWHERE = sWHERE &" AND " & "[Member]=" & me!ch2
if me!chk3 & "" <> "" then sWHERE = sWHERE &" AND " & "[BoardMember]=" & me!ch3
'PICK OFF A LEADING " AND" IF IT EXISTS
IF LEFT(sWHERE,5) = " AND " THEN sWHERE = RIGHT(sWHERE,lENsWHERE)-5)
'I doubt that you're all using the Null state
'no code included for that state
'then whichever method is used
if sWHERE & "" <> "" then
strSQL1 = "(whatever) WHERE " & sWHERE
ELSE
strSQL1 = "(whatever)" ' WITHOUT THE FILTERING
END if