Query by Form with Yes / No

  • Thread starter Thread starter Bob
  • Start date Start date
B

Bob

I am using a query by form to select and print specific records. The table
includes a yes/no field which I wish to reference in my query by form. It
now returns all "yes" records if I check the box in the query form and it
returns all "no" records if I leave the box unchecked. I would like to
modify this so that it would return all records (both yes and no values) if
I leave the box unchecked. Is this possible and if so what expression would
I have to use in the query criteria to do this? I can get the desired
result by typing "0 Or -1" in the query criteria field, but I haven't been
able to come up with an expression that references my query form that will
accomplish the same thing if the box if left unchecked. Thanks for any help
in advance.

Bob
 
Forms!FormName!CheckBoxName Or Forms!FormName!CheckBoxName = False Or
Forms!FormName!CheckBoxName Is Null

This expression as the criteria will return True records when the checkbox
is checked, and all records if the checkbox is not checked. I included the
possibility of a Null value for the checkbox in case that is the setup that
you have on your form.
 
Back
Top