PDA

View Full Version : Leave Form without saving data?



mud2
01-16-2007, 03:30 PM
My form is based on a table. I enter data into several fields in the form, some or all corresponding to fields in the table. I want to leave the form and choose either to save, or not to save (to the table) the data. The close form gives the option to save...but that only applys to the form, not the data! (?)
Stupid work-arounds...Save to a similar but different table...assign record sources before closing....

XLGibbs
01-16-2007, 07:11 PM
If the form is linked to the table, there is an option to add new records.

Best way to see this is create a form using the wizard based on the table, and view the code behind the buttons.

Otherwise, your action buttons could be added to the form, where one option executes the necessary Insert Into SQL for the append new data, or a cancel to clear the form...

maybe?

OBP
01-17-2007, 03:06 AM
A bound form always "Writes" the entered record, when you either move from that record or close the form it is "Saved".
You can however use the "Undo" command to prevent the record from being "Saved". The "Undo" command is the equivelent of pressing Esc twice.
The command is
Me.Undo

GaryB
01-17-2007, 04:56 PM
since a bound form always saves the record as OBP stated one way out of this is to, in the properties box under format have record selector set to yes and that will allow you you to select the record and delete it.

Gary