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

Application Exit and MSAccess Termination

Status
Not open for further replies.

HardingR2000

Programmer
Oct 6, 2008
40
US
Access 2002

On my main form I have a button which runs code in a module that closes the main form and then does an Application.Quit acQuitSaveNone.

When using the task manager to monitor the msaccess.exe, I have noticed a delay of up to 5-6 seconds between the time the application closes (QUITS) and the removal of msaccess.exe from the task manager window. Of course this time varies depending on the speed and resources available on the particular PC running the application.

Can I assume that the delay is due to Access and/or the OS cleaning things up?

The above scenario is acceptable because the close form and Application.Quit commands effectively remove the application and the MSAccess container from the screen and leaves the cleanup work to be done behind the scenes by the OS.

However, when the application is closed by clicking on the X box in the upper right corner of the application, not all of the application immediately leaves the screen. The MSAccess container remains on the screen until the msaccess.exe task has almost completed its cleanup work. For users with a slower or resource constrained PC it can be somewhat annoying and confusing to have the msaccess container still opened for up to 6-15 seconds after they thought they had quit the application.

Is there a solution to this problem?
 
I'd check if I've compact and repair on close.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
I checked and the app does not compact and repair on close.

I believe that the delay I am seeing between the application window closing and Access closing is the cleanup being done by Access and OS. I doubt there is much that can be done to speed this process up, but if there is I would certainly like to hear about them.

Assuming there is nothing that can be done to speed up the cleanup work, is there a way, when the X is clicked, to duplicate the Close form and Application.Quit process that removes the Access container window from the screen?
 
Jambai right for forms ( on close works)but if someone closes the database through access then code is not run. For closing may not be an issue but if you are doing other thing on clos then it a problem.

Never give up never give in.

There are no short cuts to anything worth doing :)
 
assets,

The Microsoft link that I copied in my previous reply has code to disable the close option (Alt+F4). The user can still close the application through File/Exit option or double click the application on the top left corner. You can customize the File/Exit through customize the ribbon.

Call ExitMenuState(blnState) from the code snippet on this page is not working in 2007/2010

Let me know if you find any alternative for that.

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top