managing application quit

  • Thread starter Thread starter Atlas
  • Start date Start date
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
 
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..........
 
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.
 
Back
Top