Query Criteria Using Check Box From A Form

N

Nick

I am setting up a database for my club. Having some
members out of town, I need to be able to include all or
just select local members.

I have a table called Local with a field; Post_Code. Where
I enter only local Post Codes.

I also have a query called Letter_Selection which also has
a field in it called Post_Code.

I would like to use a check box called Local, in a form
called Letter_Selection as the criteria in my query.

Using a check box, Local, in a form, Letter_Selection, to
filter local addresses by Post Code.
If “True” only the addresses that match the Post Codes in
the table Local are returned in the query. If “False”, not
checked, all addresses are returned

I have attempted to do this before without much success so
if anyone can assist please keep it simple.

Help appreciated,
Nick
 
J

John Spencer (MVP)

Not positive, but I think that SQL like the following should work.

SELECT <ListofFields>
FROM Members LEFT JOIN Local
ON Members.Post_code = Local.Post_Code
WHERE Local.PostCode Is Not Null
Or Forms!Letter_Selection!Local = 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