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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access (2010) Datasheet As Subfrm - Remove all column filters w/ cmd 2

Status
Not open for further replies.

ptsadmin

Programmer
Sep 16, 2010
2
I have a form with a datasheet subform. The columns can be filtered (like in Excel) by clicking on the down arrow and selected an individual value or a text range. The user selects all the necessary filters and, from the Parent Form, generates the report.

To remove the filters, I added a command on the Parent form for "showallrecords" and the datasheet is restored to see all records.
However, even though all the records are displayed, if you look a the individual column filter, it still indicates the original filter selection.

Visually, it appears the filter has been removed because all the records display; however, if you run the report again, you get the original filter. I have tried all ways to remove the filter but the only successful method I have found is just to open each columns filter and manually remove the filter.

For convenience of the user, does anyone know how to clear all the individual column filters with one command on the Parent form?? I feel like I am missing something that should be easy???

Any help is appreciated!!!
 
Dim frm As Access.Form
Set frm = Me.yourSubformControlName.Form
frm.Filter = ""
 
I knew it had to be simple. I was just too close to it to see it. Thanks MajP!
 
A simpler way:
Me!yourSubformControlName.Form.Filter = ""


Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top