Set Form

B

Bryan Hughes

Hello,

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

using a string for MyForm?

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

-TFTH
Bryan
 
K

Ken Snell [MVP]

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)
 
M

Marshall Barton

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
 

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