Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I reference a control within a tab control

Referencing Controls

How do I reference a control within a tab control

by  jgoodman00  Posted    (Edited  )
It seems logical to reference a control that is contained within a tab control by including the name of the tab control.

However, from many frustrating error messages, it appears that the correct way of referencing a tab control is to omit the name of the tab control.
e.g
Main form is called [color blue]frmMain[/color]
Tab control on main form is called [color blue]tab1 [/color](Imaginative name!)
Target control on tab control is called [color blue] txtExample[/color]

So it seems logical to believe the reference to the control would be:
[color blue]
[Forms]![frmMain]![tab1]![txtExample]
[/color]

However, this will result in an error message.
So, the correct reference for this is:
[color blue]
[Forms]![frmMain]![txtExample]
[/color]






Register to rate this FAQ  : BAD 1 2 3 4 5 6 7 8 9 10 GOOD
Please Note: 1 is Bad, 10 is Good :-)

Part and Inventory Search

Back
Top