Referencing a textbox in a subform

M

Matt V

I am running Access 2003 and I am trying to set a variable
to a textbox that is in a subform which is within a second
subform. I have tried :

variable = Forms!formName.textboxName
variable = Forms("formName").textboxName
variable = Form_formName.textboxName

All with no sucess. Any help would be greatly appreicated.

Thanks,
Matt V
 
M

Marshall Barton

Matt said:
I am running Access 2003 and I am trying to set a variable
to a textbox that is in a subform which is within a second
subform. I have tried :

variable = Forms!formName.textboxName
variable = Forms("formName").textboxName
variable = Form_formName.textboxName


Depends on where the reference is -

From main form:
Me.subformcontrol.Form.subsubformcontrol.Form.textbox

From subform:
Me.subsubformcontrol.Form.textbox

From subsubform:
Me.textbox

The Me. is not necessary in most situations.
 
T

Tim Ferguson

I am running Access 2003 and I am trying to set a variable
to a textbox that is in a subform which is within a second
subform. I have tried :

You need the Form property of the subform control:

strSoAndSo = Forms("MyForm"). _
Controls("MySubFormControl").Form. _
Controls("TheTextBox").Value


You can collapse this into the ! notation, but it gives you the idea of the
complete path.

Hope that helps


Tim F
 

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