Referencing field on a subsubform

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I know how to reference data (data-field-name) on a form (frm***):
[Forms]![frm***].[Form]![data-field-name]

I know how to reference data on a subform (subfrm***), nested inside a form
(frm***):
[Forms]![frm***]![subfrm***].[Form]![data-field-name]

But how to I reference data on a subsubform, a form that is nested in a form
that is nested in another form?

I've tried what I think is logical:
[Forms]![frm***]![subfrm***]![subsubfrm***].[Form]![data-field-name]
but I get an error.
 
You can refer to the value of a control on another open form using this syntax:
Forms("FormName").Controls("ControlName").Value
Which can be abbreviated to:
Forms!FormName!ControlName

If your code is running in a subform, you can get the value of a control
on the parent form with
Me.Parent.Controls("ControlName").Value

If the the control is in a subform on another form, it's

Forms("FormName").Controls("NameOfSubformControl").Form.Controls("ControlName").Value

good luck!
 
Back
Top