reference form name

  • Thread starter Thread starter Guest
  • Start date Start date
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?
 
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 <--
 
Set control1=Forms(strFormName)!ClientID

or possibly

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