Refer to a control on a subform

S

Sarah

I have a tab control which displays a subform on Page 1 and a subform on Page
2. On Page 1, I would like to reference a control from the subform on Page 2.

Does anyone know how to do this? This is what I tried and it doesn't work:

[forms]![MainForm]![subfrm2].[form]![ctrl2]

I can reference control ctrl2 from the MainForm, but not from subfrm1.

Any help would be appreciated. Thanks,

Sarah
 
D

Douglas J Steele

I'm confused as to where you're trying to reference this control from.

If you're trying to reference it from the subform on page 2 itself, you can
simply use Me![ctrl2]

If you're trying to reference from the subform on page 1, try
Me.Parent![subfrm2].[form]![ctrl2]

If you're trying to reference it from the main form, what you've got should
do it.
 
S

Sarah

Thank you!!!!!!

Douglas J Steele said:
I'm confused as to where you're trying to reference this control from.

If you're trying to reference it from the subform on page 2 itself, you can
simply use Me![ctrl2]

If you're trying to reference from the subform on page 1, try
Me.Parent![subfrm2].[form]![ctrl2]

If you're trying to reference it from the main form, what you've got should
do it.


--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Sarah said:
I have a tab control which displays a subform on Page 1 and a subform on Page
2. On Page 1, I would like to reference a control from the subform on Page 2.

Does anyone know how to do this? This is what I tried and it doesn't work:

[forms]![MainForm]![subfrm2].[form]![ctrl2]

I can reference control ctrl2 from the MainForm, but not from subfrm1.

Any help would be appreciated. Thanks,

Sarah
 
Top