I want to use a string array as an identifier to interact with a group of textboxes in a userform.
this would mean having code like
string[] Book = new string[5];
Book[1] = "Title"; Book[2] = "Author"; ...etc
Then I could use this to obtain information from the textbox. e.g. MessageBox.Show (Userform.Book[1].Text.toString());
I don't seem to be able to find a way to convert/cast the string so I can use it to identify the TextBox in the Userform so would it be right to assume it is not possible?

Dipal ChoksiRank #199 · 12K reputationPosted May 14, 2008, 8:55 PM EDT
Ijoran7 reputationPosted May 14, 2008, 9:54 PM EDT
Yes. Exactly.
I will be reading in the string information for the array from another document. Each string will have another corresponding string with related data e.g.
Book[1] = "Title"; BookData[1] = "Dictionary";
Book[2] = "Author"; BookData[2] = "Samuel Johnson";
I will then loop through both array's and use Book[] to be the identifier for the textbox in the userform. From here I can populate the textbox with BookData[] information.
Hope that makes sense.
Dipal ChoksiRank #199 · 12K reputationPosted May 14, 2008, 10:07 PM EDT
Ijoran7 reputationPosted May 14, 2008, 10:11 PM EDT
Windows System Forms
And my guess is thats going to be the wrong answer to make me a happy camper.
Dipal ChoksiRank #199 · 12K reputationPosted May 15, 2008, 8:26 AM EDT
Hi,
Here is a link to an article that describes how to get the reference to a control on a windows form by passing the name of the control. You can adapt this code to use the values from your string array to set the Text for the text boxes.
http://www.eggheadcafe.com/articles/20040506.asp
Hope this helps...
Ryan AlfordRank #1,411 · 1.2K reputationPosted May 15, 2008, 3:39 PM EDT
Ijoran7 reputationPosted May 15, 2008, 11:23 PM EDT
Looks like Form Controls are where I needed to be looking, thanks for yor help Dipal.
This goes for the hashtables as wel, cheers Ryan.