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

Prevent filters Being Saved

Status
Not open for further replies.

SeeThru

IS-IT--Management
May 2, 2002
585
GB
Hi All

I've got a form that has a quite complex recordsource (calculated fields). A couple of fields specifically make for very slow filter/sorts.

When a user closes the form, it saves the last used filter - this can make the form very slow (and seem crashed) when the next user opens it.

I have already created a custom close button, and disabled the default to one that uses acSaveNo- this works fine. However, if the user closes Access (not just the form) or shuts down windows then the changes to the filter are saved.

I have tried:

Reset the orderby in OnOpen and Onload (failed - still applies sort order first)
Reset the Orderby onClose and onUnload, so that a empty string is saved (failed - does not save emptly string, still saves last change)
Reset for using another form when database opens (failed - cannot access properties when form is closed)

Has anyone found a way to prevent a sortby applying on open, or prevent a changed sortby from being saved?

Yours Frustratedly

SeeThru
 
What about Me.OrderByON = False in the Unload event procedure ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Unfortunately not - I think it has decided the form has effectively closed, so it does not save this change.

It's very odd - easy to test, but I cna't find a sensible way around it. Seriously considering setting the forms recordsource to nothing and only applying once the form has opened. Not ideal, thuogh.
 
how are ya SeeThru . . .

Here at work access 2003 SP2 the Filter is not saved. Also FilterOn defaults to false on form open.

What version access?

Calvin.gif
See Ya! . . . . . .

Be sure to see FAQ219-2884:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top