Outputting 2D arrays

derlwyn

Registered User.
Local time
Today, 02:02
Joined
Mar 21, 2003
Messages
12
I'm reading data into a 2D array and want to output the data to a form in tabular format.

What i'd like to do, I think, is to use a listbox and to output each row in turn

I can do this by concatanating all the elements in that row together, but I'm wondering if there is an easier way, using nested for..next loop

Thanks

Emyr
 
there probably is, but without seeing a visual on something like this, you probably won't get an answer. Just the truth...
 
I'm not 100% sure if I understand the question, but if you wanted to know if you can put 2D array in a listbox, the answer is sure- you just need to define 2 columns for that listbox, then output the array- something like this:

Code:
Me.MyListBox.Columns(0)= MyArray(0,0)
Me.MyListBox.Columns(1) = MyArray(0,1)

There's a property named "ColumnCount"; that's where you would set to 2 (or 3 if you need to hide a key)
 
When populating a list box from an array use the following

For x = 0 to y 'Where y is number of elements in your array
Me.ListBox.AddItem(Array(x,0) ,x)
next

David
 

Users who are viewing this thread

Back
Top Bottom