Cancel New Record Entry

MarkA70

Registered User.
Local time
Today, 12:31
Joined
Jan 30, 2016
Messages
43
I have a form that has a button with the code:

DoCmd.GoToRecord acDataForm, "frm_Clients_0", acNewRec

I need a way to stop the new record if a button is clicked to discard changes. Have tried the me.undo but that does not work. Is there a way to stop the record being entered. THANKS!
 
should work if the button is on same form.
 
As arnelgp said, Me.Undo should work...as long as the New Record hasn't already been Saved. If it has been Saved, you'd need to Delete it, instead.

Also, if you have Default Values for one or more Controls, move to a New Record then hit the Undo Button, Focus will stay on the New Record, it will look like a New Record has been created (i.e. one or more Controls will display data, which could be confusing) but, in fact, a New Record hasn't been initiated.

Linq ;0)>
 

Users who are viewing this thread

Back
Top Bottom