Using check boxes in a form to be criteria in a query

H

HM

All,

I'm have a query which pulls 10 or so check box results from a table, along
with other text and numerical fields. I have based a report on this query
and I set up a form that has check boxes which match with the check boxes in
my query.

I'm trying to have it so when I check a box on the form the query will
return only records that have that particular box checked. I can do this
for one criteria with out a problem by using

[Forms]![Account form]![Good Driver Discount] When I have the Good Driver
Discount box checked it only returns records where the field Good Driver
Discount is checked.

I also want it to work where if i check 2 (or more boxes) it will only
return records where all corresponding fields are checked.

I tried using the IFF function to get the done in each of my criteria fields
but it hasn't been working.

IFF([Forms]![Account form]![Good Driver Discount]=No,"",[Forms]![Account
form]![Good Driver Discount])
IFF([Forms]![Account form]![Student Discount]=No,"",[Forms]![Account
form]![Student Discount])

etc....for the other 8 fields. I'm not sure im using the right qualifier
(YES/NO) to determine if a box is checked.

Any ideas would be greatly appreciated

Thanks,
 
R

Rick B

In the query design view, put the fileds in your criteria section at the
bottom (as you have stated you have done). To make them ANDs, put them all
on one row. To make them ORs put them on separate rows.

Rick B
 

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