Link to home
Start Free TrialLog in
Avatar of Andy Green
Andy GreenFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Concatenate 2 strings to make variable name

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.

Andy
ASKER CERTIFIED SOLUTION
Avatar of David H.H.Lee
David H.H.Lee
Flag of Malaysia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Andy Green

ASKER

Thanks both. I used X Coms solutions but yours faheem29484 was interesting and i've book marked just in case.

Andy