Referencing Text Box on Subform

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?
 
M

Marshall Barton

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
 
L

Luke Bailey

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top