Cancelling a Record in a Form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to figure out how to cancel a record in a form. I am using a
form that when it loads, I have date and time date being stamped, capturing
some user data, etc. I want to add a button that the user could press (I
will suppress the close window button) and it will undo changes to the
current record - before it is written and close the form.
How can I do this?

Thanks for your help.
 
-----Original Message-----
I am trying to figure out how to cancel a record in a form. I am using a
form that when it loads, I have date and time date being stamped, capturing
some user data, etc. I want to add a button that the user could press (I
will suppress the close window button) and it will undo changes to the
current record - before it is written and close the form.
How can I do this?

Thanks for your help.
.
Hi David,

DoCmd.RunCommand acCmdUndo
DoCmd.Close

Luck
Jonathan
 
David said:
I am trying to figure out how to cancel a record in a form. I am using a
form that when it loads, I have date and time date being stamped, capturing
some user data, etc. I want to add a button that the user could press (I
will suppress the close window button) and it will undo changes to the
current record - before it is written and close the form.


Hitting the Esc key twice will do that. You can get the
same effect using code behind a button bu using:

Me.Undo

It's a whole 'nother story if you want to prevent the users
from automatic saves when they just navigate to another
record or tab/xlixk into a subform.
 
Back
Top