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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Referencing SubForms and their Controls

E-mail Attached Files

Referencing SubForms and their Controls

by  Databaseguy  Posted    (Edited  )
"The complete syntax is rather complex and not at all obvious"

(Thank you Getz/Litwin & Gilbert)

Forms("MainForm")("SubForm").Form.Controls.("SubFormControlName")

If you had a sub form named MySubForm, a Main Form named MyMainForm, and a control on the sub form called myComboBox you wanted to set the visible property to false, your code would read:

Forms("MyMainForm")(MySubForm").Form.Controls("myComboBox").Visible = False
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