How t o change Control Name...

How can I convert a string to Control name.
Ex. I have a string str1="Text1", a text box control named Text1. Now I want to type cast str1 so that I get Text1.Text into another string.
Is there any way to do this in VB??
Who is Participating?
caraf_gConnect With a Mentor Commented:
Yes, you can use it to access the form's Controls collection. For example, to show the Text of a control named Text1:

MsgBox Me.Controls("Text1").Text

Of course you can replace "Text1" with a variable.

m_adilAuthor Commented:
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.