Filtering Checkboxes

G

Guest

OK...this is probably a stupid question. However, here goes... I have a
table with a field called AUDIT, which has the Yes/No Checkbox as the data
type. I have a query were I need to filter either all the boxes that are
checked or all the boxes that are NOT checked. How do I do this? It seems
like it should be simple!
 
G

Guest

For checked boxes, the value is either True or -1 (they are equivalent). For
unchecked ones it is tricky: A checkbox value is Null until it is set; it is
False (or 0) if it has been set to "off." So for checkboxes the criteria for
checked ones should read True; the criteria for unchecked ones should read
False or Is Null if you want both the ones never touched and the ones that
have actually been set to be "off."
 
G

Guest

Thanks! That help!

K Dales said:
For checked boxes, the value is either True or -1 (they are equivalent). For
unchecked ones it is tricky: A checkbox value is Null until it is set; it is
False (or 0) if it has been set to "off." So for checkboxes the criteria for
checked ones should read True; the criteria for unchecked ones should read
False or Is Null if you want both the ones never touched and the ones that
have actually been set to be "off."
 
J

John Spencer

Pardon me.

If a field (in Jet databases) is defined as a boolean field (Yes/No) then it
is never null. It is always Zero or -1.

I've tested setting a yes/no field to null. Access just sets the field to
false.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top