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!

Remove Filter

Status
Not open for further replies.

djj55

Programmer
Feb 6, 2006
1,761
US
Hello, in Access XP.

I want to blank the filter and order by properties.

I have form1 that opens form2 and sets the filter and order by of form2 based on data on form1. My problem is when I test this the filter/order is saved with form2. I have added in the form2 unload event me.Filter = "" and me.OrderBy = "" but the values are still saved with the form2.

I hope this makes sense.
Thank you for any helpful suggestions.
djj
 
Thank you for the reply.
I have tried the me.filteron = false but that did not seem to change anything.

Thanks
djj
 
In the Load event procedure of the form:
Me.Filter = ""
Me.OrderBy = ""
Me.FilterOn = False
Me.OrderByOn = False

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Hello PHV,
That was the work around I used. It would be nice to know what the MS way to solve the problem.

Thanks for the reply,
djj
 
The code I use to clear the filter is:

Me.FilterOn = False
Me.Filter = ""

Will probably work for the OrderBy as well.

Me.OrderBy= False
Me.OrderBy = ""


Hope it works for you.

McLigs
 
Thank you. The on and off is the key. To me it is not logical that setting it equal to "" should not work, but hey, whatever works.
djj
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top