i have used this code to view a message to confirm saving
the case yes & no working well
but the case cancel i need to make me remain in the same record without saving, but it work like cancel
Private Sub Form_BeforeUpdate(Cancel As Integer)
If Me.Dirty = True Then
If MsgBox("Do You Want To Save?", vbYesNoCancel + vbInformation, "Save?") = vbNo Then Me.Undo
ElseIf vbCancel Then
Me.Undo
Me.SetFocus
End If
End Sub
the case yes & no working well
but the case cancel i need to make me remain in the same record without saving, but it work like cancel
Private Sub Form_BeforeUpdate(Cancel As Integer)
If Me.Dirty = True Then
If MsgBox("Do You Want To Save?", vbYesNoCancel + vbInformation, "Save?") = vbNo Then Me.Undo
ElseIf vbCancel Then
Me.Undo
Me.SetFocus
End If
End Sub