If (Me.NewRecord And Me.Dirty) Then
Msg = "Are you sure you want to discard this entry?"
Style = vbOKCancel + vbQuestion + vbDefaultButton2
Title = "Discard An Entry"
Response = MsgBox(Msg, Style, Title)
If Response = vbCancel Then
MyString = "Cancel"
Cancel = True
DoCmd.GoToControl "[COLOR="Blue"]FirstField[/COLOR]"
Me.AllowAdditions = False
Else
MyString = "OK"
DoCmd.RunCommand acCmdUndo
Me.AllowAdditions = False
End If
End If
[COLOR="Teal"]'Keep this bit if you want to discard a blank new record[/COLOR]
If (Me.NewRecord And Not Me.Dirty) Then
Me.AllowAdditions = False
End If