Referencing sub-forms from their parents

P

Peter Hallett

Form frm_A has a sub-form, sfrm_B, which in turn has a sub-sub-form, sfrm_C.
Sub-form sfrm_B can be referenced from form frm_A, with the usual ‘Me.sfrm_B’
syntax, and any control on the latter referenced as Me.sfrm_B.ctrl_X but I
have forgotten how to reference sfrm_C, and its controls, from frm_A. Would
someone be kind enough to enlighten me?

It is just possible that a further sub-form will be added to sfrm_C and I am
therefore also interested to learn how this, and its controls, would be
accessed from frm_A.
 
D

Dirk Goldgar

Peter Hallett said:
Form frm_A has a sub-form, sfrm_B, which in turn has a sub-sub-form,
sfrm_C.
Sub-form sfrm_B can be referenced from form frm_A, with the usual
‘Me.sfrm_B’
syntax, and any control on the latter referenced as Me.sfrm_B.ctrl_X but I
have forgotten how to reference sfrm_C, and its controls, from frm_A.
Would
someone be kind enough to enlighten me?


Me.sfrm_B.Form!sfrm_C.Form!ctrlOnSfrmC

Note that, in the above, "sfrm_C" must be the name of the subform *control*
on sfrm_B, which may or may not be the name of the form object that the
subform control displays (its Source Object).

Me.sfrm_B.Form!sfrm_C.Form!sfrm_D.Form!ctrlOnSfrmD
It is just possible that a further sub-form will be added to sfrm_C and I
am
therefore also interested to learn how this, and its controls, would be
accessed from frm_A.

Similarly, "sfrm_D" must be the name of the subform *control* on sfrm_C, not
necessarily the name of its Source Object.
 
P

Peter Hallett

Thanks, Dirk.

I have got the answer buried somewhere in an old database but it would take
a week to find it and I thought that other people could share the benefit if
I got a definitive answer on the forum.
 

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