Data buffering behind the form
As you edit data on a form, the data is actually
stored in several areas in memory (areas we called
them 'buffers').
Let's trace the life cycle of an edit.
When you first navigate to a record on a form,
the data for that record is pulled from the underlying
table to the
form. This data is stored in a buffer containing a single record. Each control
on the form
then displays data from
that buffer. As soon as you start typing into a control, the data for that
single control is pulled into a second buffer.
If you tab to another control, the data from the
control buffer is written back to the form buffer,
triggering the
control's
BeforeUpdate and
AfterUPdate events. Alternaively, you can press Esc,
discarding your
changes and wiping
out the control buffer. In this case, the control's update events
are not
triggered.
As you edit controls, the entire record is still
held in the form-level buffer. None of the changes is
written back to the database at this point. If you press Esc twice, the form-level buffer is
simply
discarded. On the other hand,
if you save the record, the BeforeUpdate and
AfterUPdate events for
the form are triggered, and
the changes are
written back to the underlying table.