reference form name

G

Guest

How do I use a string value (strFormName) of a form name to set a control on
that form. i.e.

set control1=forms!strFormName!ClientID

won't work because strFormName is a string, not a form. What is the syntax I
need?
 
S

Stefan Hoffmann

hi,
How do I use a string value (strFormName) of a form name to set a control on
that form. i.e.
set control1=forms!strFormName!ClientID
won't work because strFormName is a string, not a form. What is the syntax I
need?
Use the Forms() collection: Forms(strFormName) or Forms("yourFormName").


mfG
--> stefan <--
 
D

Douglas J. Steele

Set control1=Forms(strFormName)!ClientID

or possibly

Set control1=Forms(strFormName).Controls("ClientID")
 

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