Hi,
I have several controls with an incrementing integer suffix in its name. I'm wondering if it is possible to reference the control using a variable? I can get around this using a dirty select statement but would really like to use a for loop and use the counter value.
For simplicity, I'm trying to get the following to work:
My text box controls are named Test1 and Test2 and would like to set the text along the lines of:
Hope that makes sense?
Cheers,
J
I have several controls with an incrementing integer suffix in its name. I'm wondering if it is possible to reference the control using a variable? I can get around this using a dirty select statement but would really like to use a for loop and use the counter value.
For simplicity, I'm trying to get the following to work:
My text box controls are named Test1 and Test2 and would like to set the text along the lines of:
Code:
'I could hardcode this by:
'Test1.Text = "hello"
'Test2.Text = "world"
'but would rather use the below
dim iNum as integer
iNum = 1
Test & iNum.Text = "hello"
iNum = 2
Test & iNum.Text = "world"
Cheers,
J