what syntax?

  • Thread starter Thread starter Rob
  • Start date Start date
R

Rob

Hi all,

I have a subform called frmorders and a form on that called frmorderdetails.

A main form on the DB I have set up is frmcustomer this holds the two
subforms.

I need to refer to the sub sub form as it were but cant seem to get it
right.

Can anyone tell me the syntax for this??

Is it forms![frmcustomer]![frmcustomer subform1]![frmcustomer subform2].....

or is it forms![frmcustomer]![frmorder]![frmorderdetails].....

Thanks in advance.

Rob
 
Rob said:
Hi all,

I have a subform called frmorders and a form on that called frmorderdetails.

A main form on the DB I have set up is frmcustomer this holds the two
subforms.

I need to refer to the sub sub form as it were but cant seem to get it
right.

Can anyone tell me the syntax for this??

Is it forms![frmcustomer]![frmcustomer subform1]![frmcustomer subform2].....

or is it forms![frmcustomer]![frmorder]![frmorderdetails].....

Forms![frmcustomer]![frmorder].Form![frmorderdetails].Form

The above assumes that the subform *Controls* have the same names as the forms that
they reference. This is not necessarily true and the syntax requires that you refer
to the name of the control, not the form itself.
 
Hi Rob,

First of all you need to know the name of the subform controls, which may or
may not be the same as the name of the form objects themselves. Double check
these names by clicking once on each subform control and checking the Name
property under the Other tab. With these names in mind, from the main form
your syntax would be:

From the Main Form (using the Me keyword)

me.MySub.form.MySubSub.form.Text1

Where
MySub is the name of the first subform control
MySubSub is the name of the nested subform control
Text1 is the name of the control on the nested Subform

From an external module you would replace the Me keyword with the full form
reference:

Forms!frmCustomer.MySub.form.MySubSub.form.Text1
 
Back
Top