Ok, I found some help on another board. This works if you build an event. It traps from a "dirty form" then uses the undo command only if there is something to undo. The end result is that the form closes if it has or hasn't had any data added to it, nothing is saved, no error messages are generated.
If Me.Dirty Then
DoCmd.DoMenuItem acFormBar, acEditMenu, acUndo, , acMenuVer70
End If
DoCmd.Close
|