Hello, everyone!
I add a "Yes" "No" "Cancel" option on the before update event of the form.
Also have save button on top of the form.
Is there a way to skip msgbox from BeforeUpdate in case when I click Save button? Obviously, if I click save I want to save... there is no need to ask me validation.
I add a "Yes" "No" "Cancel" option on the before update event of the form.
Code:
Private Sub Form_BeforeUpdate(Cancel As Integer)
answer = MsgBox("Do you want to save changes?", vbYesNoCancel + vbQuestion, "Confirm Save")
If answer = vbNo Then
Me.Undo
ElseIf answer = vbCancel Then
Cancel = True
End If
End Sub
Code:
Private Sub Save_Click()
On Error Resume Next
DoCmd.RunCommand acCmdSaveRecord
End Sub
Comment