By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,490 Members | 896 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,490 IT Pros & Developers. It's quick & easy.

auto filter by selection

P: 4
I need help.

I have a form with a 5 comboboxes. the form also contains a subform query with the saved records from those 5 combobox categories. What I'd like to happen is as a new record is entered and each combobox is updated the subform will automatically filter to the combo box entries.

I can get it to filter by one combobox at a time but not all at once. What i'm looking for is like "filter by selection" where the selection is my combobox data.

I'm using access 2003. Thanks ahead of time for any help you can give.
Dec 27 '07 #1
Share this Question
Share on Google+
1 Reply


nico5038
Expert 2.5K+
P: 3,072
The general idea for the solution will be to filter the form for all five combo's with a "LIKE".
To work for you this will need an "All" selection as the first option.
I use for this in general a UNION query like:
Expand|Select|Wrap|Line Numbers
  1. select "*" as ID, "<All>" as Description from tblX
  2. UNION
  3. slect ID, Description from tblX
  4.  
Now the bound column of the combo (1) will return a "*" when "<All>" is selected, thus a:
WHERE ID Like forms!yourform!combo1
will return all values.

By checking that all five combo's hold a value (and issue a warning when they don't), you can apply all filters simultaneously.

Getting the idea ?

Nic;o)
Dec 30 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.