Form Before_Update firing

  • Thread starter Thread starter JP Nemlich
  • Start date Start date
J

JP Nemlich

Hi

I have an issue with a multi-tab form in an Access 2000 ADP.

The form has multiple tabs with bound controls and a few sub-forms,
but the problem occurs on only one tab, which has a several bound
checkboxes and one sub-form.

Basically, if the user updates any of the checkboxes on this tab and
then moves to the subform or another tab, the form Before_Update event
fires. None of these checkboxes or the subform have any associated
event handlers, nor do the tab pages or the tab control, so I'm
stumped as to why the event is firing.

The event calls a load of validation code and prompts to save, but
this should only be happening once the user has finished editing the
record.

Any ideas as to why this is happening would be much appreciated.

Thanks in advance

JP
 
JP Nemlich said:
Hi

I have an issue with a multi-tab form in an Access 2000 ADP.

The form has multiple tabs with bound controls and a few sub-forms,
but the problem occurs on only one tab, which has a several bound
checkboxes and one sub-form.

Basically, if the user updates any of the checkboxes on this tab and
then moves to the subform or another tab, the form Before_Update event
fires. None of these checkboxes or the subform have any associated
event handlers, nor do the tab pages or the tab control, so I'm
stumped as to why the event is firing.

The event calls a load of validation code and prompts to save, but
this should only be happening once the user has finished editing the
record.

Any ideas as to why this is happening would be much appreciated.

Thanks in advance

Whenever you move focus from the main form to a subform or from a subform to the
main form (or another subform) then the form that just lost focus will be saved.
This is by design and cannot be "worked around".
 
Basically, if the user updates any of the checkboxes on this tab and
then moves to the subform or another tab, the form Before_Update event
fires. None of these checkboxes or the subform have any associated
event handlers, nor do the tab pages or the tab control, so I'm
stumped as to why the event is firing.

If you set focus from a mainform to any subform, the main form record
will be written to disk and its Before and AfterUpdate events will
indeed fire. Typically a Subform is used to enter data into a "many"
side table related to the mainform's "one" side table; in order to
enforce relational integrity, it's necessary to have the record saved
from the mainform in order for there to be a record to which the
subform's table can be related.
 
Back
Top