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

Hi all, does anybody know the wa

Status
Not open for further replies.

ivoef

Programmer
May 8, 2002
27
0
0
CZ
Hi all,

does anybody know the way how to intercept a class destroing that happens when method 'application.quit' is called or EXITcommand from File menu is issued?

I have a class which executes some background tasks when Access application is running. I have to remember the state of the class when tasks were interrupted by exiting Access. The problem is the instance of the class is set to Nothing before Form_Unload event is raised so I can't do any saving there.

The only solution I know is to disable MSAccess close (X) button and to supply my own exit function for File menu/Exit command.

Ivo
 
Why not try to save the state in the registry? You could create a method for the class to save the state to the registry and invoke it just prior to any Application.Quit.



-------------------------------------
scking@arinc.com
Try to resolve problems independently
Then seek help among peers or experts
But TEST recommended solutions
-------------------------------------
 
Ok. But how get you know when application.quit command was issued (e.g. user press MSAccess close button)? The class Terminate method isn't called in that case.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top