Execute commands in strings?

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
 
K

Ken Snell \(MVP\)

Dim lngO As Long
For lngO = 1 To 10
Me.Controls("txtDesc" & lngO).Visible = True
Next lngO
 
L

Laurel

Thanks. Works beautifully.
Can you recommend a good book which would introduce me to techniques like
this?
 

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