I don't want my form to automatically update a table?

J_Orrell

Registered User.
Local time
Today, 22:13
Joined
May 17, 2004
Messages
55
there must be an easier way of doing this

I have a form linked to a table. I want users to be able to enter data in the form but I do NOT want the form to update the table until the user clicks an 'ok' button. Ie I don't want the table updated if they cancel out of the form. What's the easiest way of accomplishing this? My previous methods have been successful but convoluted, involving temporarily clearing the form's Record Source and then using vba to post the form's contents to the table.

I thought perhaps the Data Entry property might do this, but it doesn't.
 
Look at "DemoDontUpdateA2000.mdb" (attachment, zip).
Open "frmJob" and try to enter a new record.
 

Attachments

Thanks that's great I can work on that.

Strange that Microsoft still hasn't given us a forms-property which temporarily disassociates a form from a table during data-entry. The other convoluted method I'd used with success is to link the form not to the destination table but to a table with a duplicate format and layout used just for data-entry. When the user clicks 'ok', transfer the completed records to the main destination table with VBA or SQL
 
Most of us just use the form's Before Update event to determine whether we save or not. For example, if you always want a button click to save the data, you use a boolean flag to determine whether the Before Update event was generated by the button trying to save the data or if the form was just being closed, etc. Then, if it was by your button you let it go through and if not you can generate a message and/or cancel the update and undo the form changes.
 
Bob is correct that BeforeUpdate is usually a good way to manage the record-level validation.

If you're looking for more of a batch process, it's not as easy but doable. Someone asked similar question and the answers still applies.

As for the comment:
Strange that Microsoft still hasn't given us a forms-property which temporarily disassociates a form from a table during data-entry. The other convoluted method I'd used with success is to link the form not to the destination table but to a table with a duplicate format and layout used just for data-entry. When the user clicks 'ok', transfer the completed records to the main destination table with VBA or SQL

If you look in the link, you will find that it is already possible to do so. It's just not a simple click of a property, and requires some VBA code but it's doable.

Good luck.
 

Users who are viewing this thread

Back
Top Bottom