Form_Before_Update event being prematurely triggered

G

Guest

Hi,

I have a bound form, with a linked subform between sets of the main form's
controls. (That is several of the bound controls appear above the subform
and several below.) When I want the focus to go to the sub form, the
form_before_update event for the main form gets triggered.

I am ready to move the subform to below all the main form controls - since I
have tried numerous solutions that have not worked - but I have it in the
middle for a good reason (follows the input form layout).

For example, I've tried finding an event that I could put in the
Form_Before_Update event subprocedure (e.g. subform gotfocus and onenter),
which would cancel the Form_Before_Update event if triggered. I have also
taken out the tab stops for the subform control and the main form's control
below the subform thinking that one of these tab stops was triggering the
Form_Before_Update.

Thanks.
 
M

Marshall Barton

sisyphus said:
I have a bound form, with a linked subform between sets of the main form's
controls. (That is several of the bound controls appear above the subform
and several below.) When I want the focus to go to the sub form, the
form_before_update event for the main form gets triggered.

I am ready to move the subform to below all the main form controls - since I
have tried numerous solutions that have not worked - but I have it in the
middle for a good reason (follows the input form layout).

For example, I've tried finding an event that I could put in the
Form_Before_Update event subprocedure (e.g. subform gotfocus and onenter),
which would cancel the Form_Before_Update event if triggered. I have also
taken out the tab stops for the subform control and the main form's control
below the subform thinking that one of these tab stops was triggering the
Form_Before_Update.


Stop! That is normal behavior. In fact it is required that
the main form save any changes before the focus moves to a
subform. The reverse is also true in that any subform
record changes must be saved before the focus can move back
to the main form (or another subform). This is absolutely
essential to maintaining referential integrity between the
involved tables.

You will have to find a completely different approach to
accomplish whatever you thought you could do by not letting
the form save it's data back to its table.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top