managing application quit

A

Atlas

Is there an easy way to trap application quit, avoiding switchboards, and
stuffing code in every form's "on close" event?


Bye

Atlas
 
A

Atlas

Allen Browne said:
Open a hidden form, and use its Unload event.

I follwed your tip, but code doesn't execute on exit. It does at startup.

Here's the code for the startup form:
'*************************************************
Private Sub Form_Load()
Me.Visible = False
End Sub

Private Sub Form_Open(Cancel As Integer)
MyInitialize
End Sub

Private Sub Form_Unload(Cancel As Integer)
SampleMenuDisable
CurrentProject.OpenConnection ""
saveCurrentSettings
End Sub
'*****************************************

I also have a "file/exit" commandbar/menutiem that fires the following:
'***********************************
Application.Quit acQuitSaveAll
'***********************************

Either exiting from the custom menu or closing Access Window, doesn't
execute the code in the hidden form..........
 
A

Allen Browne

Is it possible that the code is running but not doing what you expect?
Try adding a MsgBox() or breakpoint to the top of Form_Unload.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top