VBA Code Basics

A

Angus

I have a form which contains three text box controls (text1, text2 & text3).
Those three text boxes are all set to Visible = False. Now, I would like to
write code to make them all visible at a time through looping. Below is the
code

For x = 1 to 3
Me!["text" & x].visible = True
Next x

The above coding doesn't work, as the Access can't read the name of the
control. How can I fix it?

Thank you very much.

Angus
 
A

Angus

It works. Thank you so much.


Van T. Dinh said:
Try:

Me.Controls("text" & x).Visible = True

--
HTH
Van T. Dinh
MVP (Access)



Angus said:
I have a form which contains three text box controls (text1, text2 & text3).
Those three text boxes are all set to Visible = False. Now, I would like to
write code to make them all visible at a time through looping. Below is the
code

For x = 1 to 3
Me!["text" & x].visible = True
Next x

The above coding doesn't work, as the Access can't read the name of the
control. How can I fix it?

Thank you very much.

Angus
 

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