[RESOLVED] populating the control name from a variable
hi,
How do I explain this.. I have a form where the user enters in upto 49 values. I need to get the last 3 values entered.
example user polulates textboxes 1 to 6 (called text1,text2,text3,text4,,etc) with the values a,b,c,d
I need to pass the last 3 entered values (d,c,b) to another form. My plan was to get the txt.name of the last entered textbox (the textboxes are in order). Then I get the name and subtract 1 and the result is the name of the variable that I need to get the .Text value of.
I can get the txt.name, I can get the new name of the field I need to look up, but I cannot pass this string to the control to get the control.text value.
Maybe I am going about this the wrong way..any comments would be great.
thanks
Anne
Re: populating the control name from a variable
To reference a control by name, use the form's Controls array:
Form1.Controls(NameOfControl).Text
Re: populating the control name from a variable
Bpd, its so easy when you know...thanks a million
Anne