form filter clearing

Wysy

Registered User.
Local time
Today, 09:56
Joined
Jul 5, 2015
Messages
335
Hi,
I have a problem where i have read a lot of information about still i have not found the correct solution for my problem.
I have a form. When i click on right button the and apply a text filter everything works fine. I close the form. Upon opening again the filter is still active and the form property contains the filter in the filter line. Then i need to click again the right button and click 'clear text filter'. What i would like to achive is that upon closing the filters would be turned off and the filter line of the form property would be empty.
Tried on open/on close/on unload/on load the several variation of
me.filteron=false /me.filter="".
The closest was to apply docmd runcommand accmdremoveallfilters. However it can give a run time error.
What shall i do to turn off and clear all filter upon closing the form?
thank you
 
The filter button on the toolbar, unpressed it to turn off the filter.
 
Thank you , but i would like to have it done by closing form
 
I did not get it worked. On Close/on Open event. What is the code and at which event shall be, to achive the same as the clicking the button "clear all filter"?
 
Why not on load of the form clear out any existing filters ?

Me.Filter = ""
Me.FilterOn = False
 
It works, but the form property filter line is not cleared. Is there any way to do that?
 
Just a theoretic question. on load the me.filteron=false has no effect. The filter is not turned off. Why?
 
I think it's to do with when you can turn the filter off, the order of events firing on a form is Open > Load > Resize > Activate > Current

Also did you save the form in design view with the Filter turned off - if you save it turned on it will open like that.
 

Users who are viewing this thread

Back
Top Bottom