Concatenate 2 strings to make variable name
Posted on 2009-04-02
HiI have 6 textboxes on a form, I want to loop through them and if there is a value I want to write this back to a database.
How can I concatenate say "txtAnswer" & 1 to give me txtAnswer1 - a text box name on y form , so I can get the value like this b = txtAnswer1.text.
Or is there another (better) way to loop through the form contols.