Refer to control in a form within a tab

RichO

Registered Yoozer
Local time
Today, 08:14
Joined
Jan 14, 2004
Messages
1,036
Recently while searching this forum I came across a thread where Bob Larson had explained the syntax to get to a control within a form that was inside a tab control.

Now for the life of me I can't find that thread and have no idea what search terms I used previously.

I seem to recall the syntax was something like:

[Forms]![NameOfForm]![NameOfFormContainer].Form!NameOfControl

But I don't recall of the name of the tab control had to be in there somewhere or not. I've tried several different combinations but I always get ?Name# or #Error.

Thanks for helping.
 
You don't need the name of the tab control. In fact, pretend that the tab doesn't even exist (when coding for controls on it).

If the controls are on the tab but not on a subform, it is just like using on the regular form:

Me.YourControlName = Whatever

Or, if used on a subform within that tab then:

Me.YourSubformContainerName.Form.YourControlName = Whatever
 
Actually I was looking to refer to a subform control but from a completely different form. From your answer I was able to come up with this:

=[Forms]![AccountTabbed]![frmAccount]![Account2Subform].Form.txtTotal

And it worked.

Thanks Bob!
 
GladWeCouldHelp.png
 

Users who are viewing this thread

Back
Top Bottom