Dynamically referencing controls

yhgtbfk

Registered User.
Local time
Today, 23:55
Joined
Aug 30, 2004
Messages
123
There was no other way to describe this. Imagine 10 text boxes

Text1
Text2
Text3 etc....

Now imagine you want to set the text of a text box based on a loop.

Variable = 1

["Text" & Variable] = "sometext"

Variable = Variable + 1

This does not work. Can somebody please tell me the correct syntax.

Thank you
 
WayneRyan said:
y,

Me.Controls("Text" & Variable)

Wayne

Thanks, it worked a charm!
 
y,

Glad to hear it. You can also use the Search Facility here and look for
"Controls". There have been quite a few posts with some pretty good
stuff.

Wayne
 

Users who are viewing this thread

Back
Top Bottom