Execute commands in strings?

  • Thread starter Thread starter Laurel
  • Start date Start date
L

Laurel

I have a form that has eleven sets of controls, txtDesc1.... txtDesc2. I
need to do the same thing to all of them several times, such as
txtDesc1.visible = true, etc. Is there a way to use a string like
"txtDesc" & li_i & ".visible = true" in a loop to do this?

tia
las
 
Dim lngO As Long
For lngO = 1 To 10
Me.Controls("txtDesc" & lngO).Visible = True
Next lngO
 
Thanks. Works beautifully.
Can you recommend a good book which would introduce me to techniques like
this?
 
Back
Top