Unwanted Filter Persistence

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

Guest

How does one guarantee the Me.Filter attribute has no (or a blank) value when
opening a Form?

This Form when used can dynamically build and apply (Me.FilterOn = True)
somewhat complex criteria (using VBA). When the form is closed, the criteria
last built (Me.Filter = ...) persists, as evidenced when opened subsequently
in Design mode.

Why must this persist, since the Form is not being used/opened in Design
mode when the dynamic criteria are being built? But most of all, how does
one prevent this persistence or overcome it? Persisted criteria cause errors
when the Form is next used and new dynamic criteria applied.

Thanks
 
Try putting this into the Unload event of the form:

Me.Filter = ""
Me.FilterOn = False
 
Back
Top