I cannot set the reference to a textbox object that exists in a subform that is in a page on a TabControl.
Before I introduced the TabControl I would set the references thru the mainform as follows:
Public Sub COT1_AfterUpdate()
Dim txtTPC As TextBox
Dim txtPC As TextBox
Dim txtCOT As TextBox
Set txtCOT = Forms!frmMainOrderBatchs.sfmOrderArray!COT1
Set txtPC = Forms!frmMainOrderBatchs.sfmOrderArray!PC1
Set txtTPC = Forms!frmMainOrderBatchs.sfmTruckingArray!TPC1
End Sub
The above event is triggered from the sfmOrderArray.COT1 field. The 3rd line references a different subform on the mainform. The syntax works
Now that I have created a TabControl on the MainForm, and moved the subforms onto Page1 of the TabControl, I got the first 2 lines to work (cheating by using the Me keyword as syntax) as follows:
Set txtPC = Me.TP1
Set txtCOT = Me.P1
Notice above I didn't figure out how to reference them implicitly, I would like to know how to do that.
But I could never get the 3rd reference to set. the 'Me' keyword obviously won't do because the field I am trying to set is on a different subform on the same page. What is the proper syntax for that?
Set txtTPC = Forms!frmMainOrderBatchs!Pages!Page1!Forms!sfmTruc kingArray!.T1
(That doesn't work! I have tried too many ways and cant get it)
Help!! I would be most grateful.