Don't add record

M

Mike from Moriches

Greetings-
This must be easy. I have an input form attached to a file. I have a
command button labeled "Cancel" with an "on-click" event "DoCmd.Close" I
enter some data, but decide not to add the record. I click the Cancel
command button, but the messed up record is inserted into the file. What
command or event do I use to close the form without adding a record?
Thank-you,
Mike
 
J

John W. Vinson

Greetings-
This must be easy. I have an input form attached to a file. I have a
command button labeled "Cancel" with an "on-click" event "DoCmd.Close" I
enter some data, but decide not to add the record. I click the Cancel
command button, but the messed up record is inserted into the file. What
command or event do I use to close the form without adding a record?
Thank-you,
Mike

Before the Close line, put a line

Me.Undo

if you want to prevent the record from being saved.
 
P

PieterLinden via AccessMonster.com

Mike said:
Greetings-
This must be easy. I have an input form attached to a file. I have a
command button labeled "Cancel" with an "on-click" event "DoCmd.Close" I
enter some data, but decide not to add the record. I click the Cancel
command button, but the messed up record is inserted into the file. What
command or event do I use to close the form without adding a record?
Thank-you,
Mike

Me.Undo
 

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