Article ID: 181820
Article Last Modified on 11/6/2000
Sub Form_BeforeUpdate (Cancel As Integer)
' This procedure checks to see if the data on the form has
' changed. If the data has changed, the procedure prompts the
' user to continue the save operation or cancel it. Then the
' action that triggered the BeforeUpdate event is completed.
On Error GoTo Err_BeforeUpdate
' The Dirty property is True if the record has been changed.
If Me.Dirty Then
' Prompt to confirm the save operation.
If MsgBox("Do you want to save?", 4 + 32, _
"Save Record") = 7 Then
Cancel = True
SendKeys "{ESC}"
End If
End If
Exit_BeforeUpdate:
Exit Sub
Err_BeforeUpdate:
MsgBox CStr(Err) & " " & Error(Err)
Resume Exit_BeforeUpdate
End Sub
Additional query words: inf saving ask asking prevent
Keywords: kbhowto KB181820