Query based on Check Box

  • Thread starter Thread starter stretch
  • Start date Start date
S

stretch

I have a query that uses multiple criteria entered into a form. The user is
able to search using any of a number of fields to find records from a table.

I have the following example expression for numerous fields in the criteria
of the query;

Criteria: Like [Forms]![search enquiries]![Quoted By] & "*"
or: Is Null

This works fine but i now want it to return records based on if some
checkboxes are ticked as well.
What would be the criteria in the query for the fields with checkboxes, to
allow this to work?

Thanks in advance
 
Checkboxes are usually Yes/No data types. Yes or No will work but don't put
quotation marks around them. Better yet 0 means No and -1 means Yes in Access
Yes/No data type fields. Something like below would find No records.

AND [Forms]![search enquiries]![YesNo] = 0
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


stretch said:
I have a query that uses multiple criteria entered into a form. The user is
able to search using any of a number of fields to find records from a table.

I have the following example expression for numerous fields in the criteria
of the query;

Criteria: Like [Forms]![search enquiries]![Quoted By] & "*"
or: Is Null

This works fine but i now want it to return records based on if some
checkboxes are ticked as well.
What would be the criteria in the query for the fields with checkboxes, to
allow this to work?

Thanks in advance
 
Back
Top