Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Populating a form from an array

Status
Not open for further replies.

artadmin

MIS
Oct 3, 2002
17
US
I get a string from a text file
then I parse it to an array
currently, I have an MsgBox MyString, that displays the contents of the string.
I'd like to instead display that string in a nice column format within a form. I figure I can do it after I split the string into an array.

Thus, when form2 becomes visible, it shows:
array(1) array(2) array(3) array(4)
array(5) array(6) array(7) array(8)
etc.

Problem:
I don't know how many elements will be in the array, once it has been split.

How do I make form2 display the parts of the array in a clean column format?
 
You can check the number of elements with the UBound function.

Num. of Elelments = UBound(array) + 1

The one is added only if your array is 0(zero) based. This is the default for the split function.

Thanks and Good Luck!

zemp
 
Or, you can just use a For/Each statement. Then you do not need to worry about UBound(), LBound(), or what base it is.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top