Set Form

  • Thread starter Thread starter Bryan Hughes
  • Start date Start date
B

Bryan Hughes

Hello,

How can I Set frm = [Forms]![MyForm]![SubForm]

using a string for MyForm?

Set frm = [Forms]![ & strMyForm & ]![SubForm]

-TFTH
Bryan
 
Your post suggests that you want to set a form object to a subform control.
( [Forms]![MyForm]![SubForm] is the reference to a subform control named
SubForm on a form named MyForm. ) Note that a subform is not open on its
own, and does not exist as a form object.

Assuming that you wanted to set a form object to the name of the main form,
where the name of the form is in a variable named strMyForm:

Set frm = Forms(strMyForm)
 
Bryan said:
How can I Set frm = [Forms]![MyForm]![SubForm]

using a string for MyForm?

Set frm = [Forms]![ & strMyForm & ]![SubForm]


Set frm = Forms(strMyForm)!SubForm.FORM
 
Back
Top