View Full Version : Filtering A form with multiple checkboxes


ppete
01-16-2002, 03:11 AM
Can anyone help?

I want to filter a form with a number of check boxes.

I've got two checkboxes for a field called Market, (UK & Europe), four more for ShopType and another for ShopStatus. I've started out using the following code behind the after update property of the checkbox...

If chkBoxA.Value = True then
Docmd.Applyfilter "[Market] = '"UKR"'

...but I have a feeling this is taking a very long way to do something simple. Any help would be greatly appreciated.

Ppete

Rich_Lovina
01-16-2002, 03:22 AM
Have you tried using the QBE option which can handle almost endless criteria? It takes off where filter runs out of flexibility.

ppete
01-16-2002, 04:09 AM
Thanks for the reply Rich,

but as far as I can see this only solves the problem if I can send values into the query depending on which checkboxes are checked. I'm afraid I'm still a bit lost.

Ppete

ppete
01-17-2002, 04:25 AM
I thought this was going to be a simple fix but after consulting with this forum, books, on line help and workmates I am still none the wiser.

The only way I can think of to get around this prob is to constuct a dynamic sql statement with loads of If ... then... else or Select case statement.

Has anyone else got any suggestions? I want to reduce the recordset to show only the records that correspond to the ticked checkboxes but the checkboxes refer to 3 different fields.

Thanks in advance for help / advice,

Ppete