469,631 Members | 1,218 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,631 developers. It's quick & easy.

auto filter by selection

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
1 2511
3,080 Expert 2GB
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
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 ?

Dec 30 '07 #2

Post your reply

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

Similar topics

7 posts views Thread by damjanu | last post: by
16 posts views Thread by Nhmiller | last post: by
11 posts views Thread by Bob | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.