Hello, I’m trying to fill a Multi-Dimensional Array and then fill the textboxes with the data.
The array has 10 rows and 2 coloms. On the left colom I want the textboxes to show the numbers 1-10 and
in the right colom i want the the number on the left colom squared. I’m lost.
Code follows:
Code:
'// Populating Array…
Dim sq(10, 2) As Integer
Dim i, j As Integer
For i = 0 To 9
For j = 0 To 1
If j = 0 Then
sq(i, j) = i
ElseIf j = 1 Then
sq(i, j) = i * i
End If
Next
Next
'// Get values from Array put in TB...
Dim l As Integer '= 1
Dim obj As Object
Dim objtext As TextBox
For i = 0 To 9
For j = 0 To 1
For Each obj In Controls
For l = 1 To 20
If TypeOf obj Is TextBox Then
objtext = obj
If objtext.Name = ("TextBox" & l.ToString) Then
obj.text = sq(i, j)
End If
End If
Next l
Next
Next
Next
any suggestions are appreciated.
Thanks