Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Clear All Filters in Access 2007

Status
Not open for further replies.

McLiguori

Technical User
Mar 27, 2003
90
IT
In Access 2007 in the Sort & Filter box, under Advanced, there is an option to clear all filters that becomes enabled as soon as you filter anything on the form.

In not only does not apply the filter, it eliminates it.

I have a couple of reports that pick up the form filter (.ME filter). Once I filter for something on the form, the reports keep picking up that filter, whether I toggle it off or not. The only thing that seems to clear the filter so the report does not pick it up is the "Clear All Filters" option from the Advanced button of the sort & filter box.

What is the code to program a button to do the same thing?

I tried creating a macro but the clear all filters is not offered as an option.

Thanks in advance for any help you can give me.

McLigs
 
You wanted this ?
Me.FilterOn = False
Me.Filter = ""

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
How are ya McLiguori . . .

Pre 2007 to remove filtering in code was a simple:
Code:
[blue]   Me.FilterOn = False[/blue]
However the form would still [blue]save the Filter value[/blue]. So although the filter is turned off its value is still there, hence your problem.

Removing the [blue]Filter Value[/blue] before you close the form is all you need.
Code:
[blue]   Me.Filter = ""[/blue]




Calvin.gif
See Ya! . . . . . .

Be sure to see FAQ219-2884:
 
Thanks so much PHV and Ace Man 1.

So simple. Your solution was eggsactly what I was looking for.

And Yeah, Ace Man, you pegged the source of my problem just right.

Thanks again!

McLigs
 
I have a related situation.

The Report_Close event contains the code above. When I close the report and remove the filter on the form, I want the report to return all unfiltered data when I run the report again.

It keeps returning filtered data. If the filter is changed, it reflects this. I just can't get the report to return unfiltered data without closing and reopening the report and form.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top