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..........