Refer to a control on a subform

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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.
 
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
 

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

Back
Top