Controlling saving or not in a form

N

Nic

I want to use a form for data entry into a table, but I want the user to
just use my buttons in order to either "save" the record they were creating,
or hit the "Cancel" button to just close the form without any saving of the
data they had entered.

How can I limit the form's internal Access way of handling data saves to the
way i want to handle it?

Thanks!
-Nic
 
N

Nic

Update:
Ok - i've set the "Cancel" property of my cancel button to true..and then i
have a
DoCmd.close , , acSaveNo
in the code for the onclick event of my Cancel button.
But after the cancel button is pressed the record is still saved.
How do i tell it to disregard everything if the cancel button is pressed?

-Nic
 
G

GaryS

Nic,

I usually ask questions here, not answer them, but your
solution may lie in using the command / action / method
Undo. Just something I saw somewhere . . . I'll be
watching for the real answer!

Gary
 
R

Rick Brandt

Nic said:
Update:
Ok - i've set the "Cancel" property of my cancel button to true..and then i
have a
DoCmd.close , , acSaveNo
in the code for the onclick event of my Cancel button.
But after the cancel button is pressed the record is still saved.
How do i tell it to disregard everything if the cancel button is pressed?

The acSaveNo is referring to design changes of the form, not to data.

You need instead...

Me.Undo
Do.Cmd.Close
 
Top