Refer to objects using variables

shacket

Registered User.
Local time
Today, 07:59
Joined
Dec 19, 2000
Messages
218
Let's say I have a form with 3 text boxes named:

Text1
Text2
Text3

and I want to each text box to say:

"This is box number X" (where X is the number of the box)

How do I use a variable to cycle through with a For statement to refer to each box such as:

For i=1 To 3
Me.Text = "This is box number " & i
Next i

In other words, how do I use a variable as part or all of the name of an object I want to refer to?

Thanks for your help.
 
For i = 1 To 3
Me("text" & i) = "This is box number " & i
Next i
 

Users who are viewing this thread

Back
Top Bottom