So i have this code:
Private Sub Form_BeforeUpdate(Cancel As Integer)
If Me.Dirty Then
'Ensure that users do not accidentally save records
If MsgBox("Do you want to save the updated records?", vbOKCancel, "Save?") = vbCancel Then
Me.Undo
End If
End If
End Sub
How do i add a code inside that creates an exception for a button that goes to a new record? I want to add the exception for my add new record button but i dont know which function/command to use
Private Sub Form_BeforeUpdate(Cancel As Integer)
If Me.Dirty Then
'Ensure that users do not accidentally save records
If MsgBox("Do you want to save the updated records?", vbOKCancel, "Save?") = vbCancel Then
Me.Undo
End If
End If
End Sub
How do i add a code inside that creates an exception for a button that goes to a new record? I want to add the exception for my add new record button but i dont know which function/command to use