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

Reference to a control on tabctl on subform 2

Status
Not open for further replies.

zollo9999

Programmer
May 12, 2002
95
AU
Hi

I'm running the following line of code from the main form in a combo box on the after update event.

I am trying to change the caption value of a label on a sub form, that is also on a tab control.

The Object Structure is:
Main-form > Sub-Form > Tab-Control > Label

The code is

Forms!frmSnssDb!sfcFinancialYear!tclFinance.Pages!pge0506.Controls.lblCostCode0506.Caption = "LDC"

The error I'm getting is Runtime Error 438 - Object does not support this property or method.

The trouble is I can't figure out which property or method it doesn't like.

Any clues?

Thanks


Zollo A+ / VBA Developer
[thumbsup]
 
Hope this works. Give it a try

Forms!frmSnssDb!sfcFinancialYear.Form.lblCostCode0506.Caption = "LDC"

Regards
 
Zor
Thanks that works great.
I missed out the Subform Form property,
but I read that it was not necessary to use it.

And I assume I was making it unnecessarily complicated, by including the tabcontrol and page references.

Thanks again.
Zollo


Zollo A+ / VBA Developer
[thumbsup]
 
Good!. As far as I know, you do not have to refer to a tab control in code if you want to get reference to an object on the tab control itself, the components on the tab control are as if they were put on the form itself. Hope I'm correct. Regards
 
You will know how to refer to Form/Subform/controls if you read this article at mvps.org

________________________________________
Zameer Abdulla
Visit Me
Minds are like parachutes. They only function when they are open. -Sir James Dewar (1877-1925)
 
Thankyou Zameer, hope your well. Have a star for that link, very usefull. Regards
 
And thanks from me too.

I also found the article very useful and will keep a reference copy of it so I can fully absorb it.

Another star too.

Zollo

Zollo A+ / VBA Developer
[thumbsup]
 
Thank you ZOR & Zollo

________________________________________
Zameer Abdulla
Visit Me
Minds are like parachutes. They only function when they are open. -Sir James Dewar (1877-1925)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top