From AFN Maintainer :
How do I go about doing this? What do I need to do?
<snap!>
Something like
If Me.Dirty Then
Call Beep
Dim iAnswer As Integer
iAnswer = MsgBox("Save changes?", vbQuestion + vbYesNoCancel)
If iAnswer = vbYes Then
Call DoCmd.RunCommand(acCmdSaveRecord)
Call DoCmd.Close(acForm, Me.Name)
ElseIf iAnswer = vbNo Then
Call DoCmd.Close(acForm, Me.Name, acSaveNo)
End If
Else
Call DoCmd.Close(acForm, Me.Name)
End If
(this one is for the unload of the form but can be easily modified to
work on, for example, the beforeupdate)