Prohibit Automatic Record Update when focussing between Forms

M

Michael

I have created a Form containing a SUBFORM. I would like to prohibit, that
the Recordset is automatically updated, when the Focus is changing between
the Forms.
The BeforeUpdate does not work, because I cannot distinguish if I initiated
an Update by myself or by the Focus procedure.

How can I do that?
 
R

Rick Brandt

Michael said:
I have created a Form containing a SUBFORM. I would like to prohibit,
that the Recordset is automatically updated, when the Focus is
changing between the Forms.
The BeforeUpdate does not work, because I cannot distinguish if I
initiated an Update by myself or by the Focus procedure.

How can I do that?

You can't. If you want to emulate a "thin client" model where the user can
makes all kinds of changes to any number of records and none of that is saved
until some button is pressed then Access is really not a very good tool to be
using. Or rather, one could say that nearly all of the advantages that using
Access has over other tools are tossed out the window when you use it to build
such an application.

In a standard form you can ask the user in the BeforeUpdate event if they want
to save their changes or whether they were just pounding on their keyboard for
the hell of it. If they indicate the latter you cancel the event and issue an
Undo on the form.

In a form with a subform there is no way to stop the saving of the form losing
focus so you would have to bind your forms to dummy work tables and then use
append, update, and delete queries to push their changes to the real tables when
they decide to commit them.
 
Top