I am trying to populate my combo box and text boxes from array, that I already populated. I chcek if a value in an array is same as my gird Bookmark. then populate the combo box.
i=0
'check if I have rows in my array
If mlarrayMaxRows<> 0 Then
'Loop through rows
Do While i <= mlarrayMaxRows
If i = 0 Then
ReDim Array(mlMaxCols, i + 1)
Else
ReDim Preserve Array(mlMaxCols, i + 1)
End If
If Array(ITEM, i) = sItemID
---something here
If Not Array(QTY, i) Then
txtQty.Text = Array(QTY, i)
Else
txtQty.Text = ""
End If
cbo.Text = Array(LINE, i) + Space(5) + Array(ITEM, i)
Endif
i =i +1
Looop
The problem is if I don't use ReDim Preserve Array(mlMaxCols, i + 1) or ReDim Array(mlMaxCols, i + 1) then I get error "Subscript out of range (Error 9)".
The second problem is if I use Redim then My array comes to be blank.
Any views..
i=0
'check if I have rows in my array
If mlarrayMaxRows<> 0 Then
'Loop through rows
Do While i <= mlarrayMaxRows
If i = 0 Then
ReDim Array(mlMaxCols, i + 1)
Else
ReDim Preserve Array(mlMaxCols, i + 1)
End If
If Array(ITEM, i) = sItemID
---something here
If Not Array(QTY, i) Then
txtQty.Text = Array(QTY, i)
Else
txtQty.Text = ""
End If
cbo.Text = Array(LINE, i) + Space(5) + Array(ITEM, i)
Endif
i =i +1
Looop
The problem is if I don't use ReDim Preserve Array(mlMaxCols, i + 1) or ReDim Array(mlMaxCols, i + 1) then I get error "Subscript out of range (Error 9)".
The second problem is if I use Redim then My array comes to be blank.
Any views..