Sync two subforms

G

Guest

I have a main form that contains two subforms. Both subforms have a common
record source. The first subform is used to input data for single record.
The second subform is used to display the entire contents of the record
source.

When I enter new record data into the first subform I want to requery the
second subform to reflect the new record in the record source. The problem I
have is that subform one cannot "see" subform two , therefore, I cannot
requery subform two directly from subform one. I am thinking it has to be
done in the main form, but I cannot figure out what event in the main form is
appropriate to trigger the requery of subform two.

Sorry for the long explanation. Help is appreciated.
 
G

Guest

Hi Richard,

How about a simple solution like this: in the after update event of your
first subform, have the following code:

forms!MAINFORMNAME.SUBFORMCONTROLNAME.form.requery

Where MAINFORMNAME is the name of the main form (surprise) and
SUBFORMCONTROLNAME is the name of the subform control on the main form that
houses your second subform (the one you want to requery).

Hope this helps.

Damian.
 

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