On my form, I have a command to edit data, save data, and cancel changes and these all work well. I want to include a message if the current record is dirty and the user uses changes the record without saving changes. I tried setting the following code in the forms current even, but it doesn't seem to check if the current record is dirty. It appears to look at the condition of the next record, however if I check for Dirty with my Cancel Changes command, it recognizes the form is dirty.
Any Thoughts?
Code:
If Me.Dirty = True Then
response = MsgBox("Change Record and Discard Changes?", vbYesNo)
If response = vbYes Then
DoCmd.RunCommand acCmdUndo
Else
Exit Sub
End If
End If