Code: Select all
Private Sub cmdEXIT_Click()
If MsgBox("Did you click the SAVE BUTTON?", _
vbQuestion + vbYesNo, "CONTINUE?") = vbNo Then
'IF USER SELECTS NO - THEN ALLOW TO HIT SAVE
DoCmd.CancelEvent
Else
'IF USER SELECTS YES - EXIT
DoCmd.Close
End If
End Sub
I would like add the following pseudocode:
If no changes are made to this record, DoCmd Close.
I tried adding this to the beginning of the above code:
Code: Select all
If Me.Dirty = False Then
DoCmd.Close
End If
Can you help me with the proper syntax?
Thank you !
Michael