Hi. I have a form with subforms to enter various data.. Whenever I closed my form using the "x" on the upper right side or the form.. Whatever data/information that are left in the form will be saved to my table. (this happens when a user enter some data then suddenly realized not to continue entering data and closes the form). I want to undo this but i cant find a way to work.. here are some code that I found but doesn't work in my forms.. any help is appreciated... thanks..
here are similar code that I found but this is done in BeforeUpdate event
If Me.Dirty Then
If MsgBox("Do you want to save the changes?", vbYesNo) = vbNo Then
'Undo all the changes
Me.Undo
End If
End If
End Sub
here are similar code that I found but this is done in BeforeUpdate event
If Me.Dirty Then
If MsgBox("Do you want to save the changes?", vbYesNo) = vbNo Then
'Undo all the changes
Me.Undo
End If
End If
End Sub