Referencing a Subform's Control On A Tab Control

T

Tru

I am trying to reference a control (txtName) on a subform
(cfrmComPicturesSUB) which is on a tabControl (tabItems)
page 2 or index 2.
I tried using the following syntexts:

a) Me!tabItems.Pages(2).Controls!
[cfrmComPicturesSUB].Form![txtName]

b) Forms![cfrmComInfo]![cfrmComPicturesSUB].Form![txtName]
 
V

Van T. Dinh

(b) is correct *provided* that [cfrmComPicturesSUB] is the
name of the Subform*CONTROL*. The SubformCONTROL name may
be different from the name of the Form being used as
Subform (or more technically accurate, being used as the
SourceObject of the SubformControl).

You need to find the correct SubformControl name from the
DesignView of the main Form [cfrmComInfo].

HTH
Van T. Dinh
MVP (Access)
 

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