Please explain this syntax

sjr1917

Registered User.
Local time
Today, 12:21
Joined
Dec 11, 2012
Messages
47
Assume a form (myForm)
containing a combobox (cboName).
Also on the form is a tabControl (TabCtrl18)
containing a subForm (sfrmItems) on one of its pages
is a textbox (txtName)

I have successfully set txtName = cboName.Column(1)
when the user clicks on the containing page of the tabControl.

My question is why do I have to fully describe the left side of the "=" but not the right side? Access's syntax with regard to identifying the various controls still often eludes me. Also, the current "Me" is confusing... it seems to refer myForm, but why wouldn't it refer to sfrmItems, since it was that form that contains the control that fired the subroutine.

Here's what works: (it resides in the TabCtrl18_Change subroutine)
Me!sfrmItems.Form.txtName = cboName.Column(1)

Thanks for any light! Also, if you know of a source that describes the intricacies of Access's control referencing syntax that would be SUPER!
 
Thanks, Jdraw & Pat

Pat, I follow your comment re: intellisense and the use of "." And the processing time saving feature of adding Me. to the right side of the equation.

I'm finding Access's syntax a bit confusing coming out of a dBase (hate to admit it) background where you'd reference the whole class chain: myForm.TabCtrl.subForm.txtBox

It appears (studying the reference page jdraw offered, and the code that worked for me) that it's only forms (& subforms) that truly "contain" controls. The textbox on the tabcontrol on the subform is not referenced with the tabcontrol in the class chain, only as a child of the subform ( and it's parent the main form). Is that correct?
 

Users who are viewing this thread

Back
Top Bottom