Replace information if not saved

J

Jadabug

I have three fields in a form that are linked back to the table. If
someone changes the record in the form, and then decides not to save,
is there a way to undo their changes and revert back to the record
before it was ever opened? Does this make sense? Thanks!
 
J

Jadabug

Jadabug said:
I have three fields in a form that are linked back to the table. If
someone changes the record in the form, and then decides not to save,
is there a way to undo their changes and revert back to the record
before it was ever opened? Does this make sense? Thanks!

Me.Undo
 
J

John Vinson

I have three fields in a form that are linked back to the table. If
someone changes the record in the form, and then decides not to save,
is there a way to undo their changes and revert back to the record
before it was ever opened? Does this make sense? Thanks!

Several ways. They can press the <Esc> key twice - once to cancel the
update of the current field, and the second to cancel the update of
the entire record. Or you can put a Command Button on the form to
execute the code:

Private Sub cmdCancel_Click()
Me.Undo
End Sub

Or you can set the Cancel argument of the form's BeforeUpdate event to
True (unless you have somehow determined that they really do want to
update).

John W. Vinson[MVP]
 
Top