jazzz,
Thanks for your reply AND your patience. This SHOULD be straight-forward...
The value is false
(I think it should be true at this point, as I brought up the form and selected the Exit button. My previous post indicated Close in error.)
I'll copy/paste all of what I think is the relevant code.
It's quitting time for me, so I won't be able to check back for a while, maybe even tomorrow.
Thanks again!
Bob
======================================================
'GLOBAL VARIABLES, OPTIONAL ROUTINES AND MISCELLANEOUS
'FOLLOWING IS TO REQUIRE CONTROLLED EXIT FROM DATABASE, NOT "X'ING OUT"
Public pblnAllowClose As Boolean
======================================================
Private Sub Form_Load()
On Error GoTo Err_Form_Load
'INITIALIZE VARIABLE THAT WILL REQUIRE USER TO EXIT GRACEFULLY
pblnAllowClose = False
====================================================
Private Sub Form_Unload(Cancel As Integer)
Debug.Print pblnAllowClose
MsgBox "Check Immediate window for value of pblnAllowClose", vbOKOnly, "CHECK PBLNALLOWCLOSE"
Cancel = Not pblnAllowClose
If pblnAllowClose = False Then
MsgBox "You cannot X out of the database, please use the EXIT button", vbOKOnly, "CANNOT X OUT"
Cancel = True
End If
End Sub
========================================================
Private Sub EXIT_Click()
On Error GoTo Err_EXIT_Click
If Me.Dirty Then
Me.Undo
End If
'SET VARIABLE TO INDICATE USER *IS* EXITING GRACEFULLY
pblnAllowClose = True
Application.Quit acExit
Exit_EXIT_Click:
Exit Sub
Err_EXIT_Click:
MsgBox Err.Description
Resume Exit_EXIT_Click
End Sub