Using tickbox/dropdown on form to customise query

Rik_StHelens

Registered User.
Local time
Today, 15:41
Joined
Sep 15, 2009
Messages
164
Hi everyone,

I have set up a email contacts database for creating email lists. It contains both fleet and tyre dealer customers.

I have created a form which (will) allow users to customise the query to give them the appropriate list of contacts. The form has a series of dropdown and tick boxes to allow users to select options.

For example, a user can create a list of all "Dealers" (dropdown) "accountants" (dropdown) who are dedicated on "breakdown network 1" (tickbox).

How can I use the tickbox so that:

If checked it gives me all dealers on network 1
If unchecked it gives me everything, rather than only dealers who are NOT on that network.

I was going to try IIF(Forms!MyForm!MyCombo=Yes,"Yes","No") but this doesn't provide the flexibility users need to create custom lists.

Thanks for your time/help
 
Best done with a dynamic query built in VBA. Basically the code uses If Then Else sections to construct the text of the sql statement based on the form settings.
 
Is there a good example anywhere that you would recommend?

& if not, is there another way around this for someone who has never written VBA

Thanks
 

Users who are viewing this thread

Back
Top Bottom