Referencing a textbox in a subform

  • Thread starter Thread starter Matt V
  • Start date Start date
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
 
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.
 
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
 
Back
Top