How to cancel changes to NEW record.

G

Guest

I want to programatically cancel ALL pending additions to a NEW record
associated with a form.

eg there are 2 fields. Go to NEW record. Enter new data (but not yet changed
in table). How can I cancel the LOT.

OR equivalent to 2 presses of the escape key.
 
W

Wayne Morgan

You can Cancel the update by setting Cancel = True in the form's
BeforeUpdate event. You can undo the changes the user made with the command
Me.Undo. If you Cancel the update, but don't undo the changes, as soon as
you try to move off of the record, Access will try to save it again.
 
J

John Vinson

I want to programatically cancel ALL pending additions to a NEW record
associated with a form.

eg there are 2 fields. Go to NEW record. Enter new data (but not yet changed
in table). How can I cancel the LOT.

Set the Cancel property of the BeforeUpdate event to True (after
checking Me.NewRecord if necessary).
OR equivalent to 2 presses of the escape key.

Me.Undo


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

Top