
committing/rolling back all changes on form
I believe you'll have to use temporary tables. Microsoft should have a
sample database for you to download at their site. The sample is for order
entry where you have an Form based on the order table and a Subform based on
the order detail lines. When you open an existing order, the original
information is written to two temporary tables: one for the order and the
other for the detail lines. That way, if you can restore the original order
when you click the cancel button on the Order form. Perhaps you can use
this technique for your application.
Quote:
>In Access, how do I determine if all the changes that have been made to
>a form are committed or rolled back?
>The application I am working has a requirement that the user be able to
>save the changes (Access' default behavior) or cancel the changes (the
>challenging part).
>My first thought was to place a call to DbEngine.BeginTrans in the open
>or load event procedure and a call to DbEngine.Commit or
>DbEngine.Rollback in the unload or close event procedure. This,
>however, does not work because access implicitly commits when moving off
>a record. At this point I should mention that the main form (which will
>probably only be used to view a single record at a time) has several
>subforms.
>Of course there is the before update event procedure that can be
>canceled, but that has the problem of only applying to one form (the
>main form or one of the subforms).
>Thanks,
>Matt