Referencing Text Box on Subform

  • Thread starter Thread starter Luke Bailey
  • Start date Start date
L

Luke Bailey

To reference a text box on a form for a value, you use
something like strMyVal = forms![form 1]![txt MyString].
How do you reference a text box from a subform?
 
Luke said:
To reference a text box on a form for a value, you use
something like strMyVal = forms![form 1]![txt MyString].
How do you reference a text box from a subform?


The general syntax is:
Forms!mainform.subformcontrol.Form.textbox

Or, from the main form containing the subform:
Me.subformcontrol.Form.textbox

Or, from a subform to its mainform:
Me.Parent.Control.Form.textbox
 
That's what I needed.

Thanks!
-----Original Message-----
Luke said:
To reference a text box on a form for a value, you use
something like strMyVal = forms![form 1]![txt MyString].
How do you reference a text box from a subform?


The general syntax is:
Forms!mainform.subformcontrol.Form.textbox

Or, from the main form containing the subform:
Me.subformcontrol.Form.textbox

Or, from a subform to its mainform:
Me.Parent.Control.Form.textbox
 
Back
Top