Replace information if not saved

  • Thread starter Thread starter Jadabug
  • Start date Start date
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!
 
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
 
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]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top