Unwanted Filter Persistence

M

Maul Man

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
 
M

MDW

Try putting this into the Unload event of the form:

Me.Filter = ""
Me.FilterOn = False
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top