The process I use (think I got it from Tek-Tips, but can't remember from whom) is this:
Create a form called frmExit with one check box (chkExit) whose default value is false. This code is in the Unload event:
Private Sub Form_Unload(Cancel As Integer)
If chkExit = False Then
Cancel = -1
End If
End Sub
In the On Open event of my main menu form I open frmExit as follows:
DoCmd.OpenForm "frmExit", , , , , acHidden
This effectively disables the Application close button.
In the Click event for the cmdQuit button on the main menu I change the status of the check box to True:
Forms!frmExit.chkExit = True
Once the chkExit value is true, the database can close normally.
Simple and effective.
Hope this helps. Larry De Laruelle
ldelaruelle@familychildrenscenter.org