I have a bound form with code to undo a record if the user closes the form without saving the changes. For some reason, even after typing and tabbing through controls, Access isn't registering that the form is dirty. (Or I'm not grasping the meaning of "dirty"). The form is opening to a new record should not save the record if the user doesn't say "Save"...
My code is below:
Code:
Private Sub Form_Close()
If Me.Dirty Then
DoCmd.SetWarnings False
DoCmd.RunCommand acCmdUndo
DoCmd.SetWarnings True
Else
MsgBox "didnt catch"
End If
End Sub
Is this because I'm adding a new record and not actually changing an existing record?