Filter using multiple fields

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I would like to implement a filter on a form (using a command button) where
the situation is like this:

1. the first parameter would ask (or have an input) for a code; this would
come from a series of fields (Source1-Source10) where "03D" for example can
be located in any of these fields.
2. Then I need a subset of that code by state (for example, code 03D in PA)
3. the form need to refresh to ONLY show these records.

Any help would be greatly appreciated.

Thanks.
 
Thanks for your response. I did figure out this filter. What I need now is a
way to refresh the form once the filter is applied; also to remove the filter
after the users are finished with the subset of records.
 
The "Filter by Form" form has an "Apply Filter" icon, which will return you
to your data form and apply the filter automatically, which refreshes your
form. There is also an icon/menu option to "Remove Filter" which will show
all records in your data form again.
 
Sorry for the confusion. I do not wish to use the toolbar - yes, I can do it
.. As a matter of fact, it is removed for users not to fool around with it and
mess things up.
The "refresh" function for the form should come from the code behind the
button.

Thanks.
 
Ahh...
So you've built your filter--some kind of sql statement to change the form's
Filter property, and then set the FilterOn property to True. Either the
form will automatically requery after setting the FilterOn property, or you
can just execute a Me.Requery command. To remove the filter, you can set
the form's Filter property to and empty string ( "" ) and/or set the
FilterOn property to False, or use DoCmd.ShowAllRecords.
 
Back
Top