Hi guys how are you!
I need your help about this routine please?
I have an unbound datagrid with 6 columns the first column or column 0 is set to no visible. so in run time the grid display only 5 columns but when I read with the columns properties this read only 4 columns and gave me a mesage like this "Subscript out os range" here is my code for your review

With DBGrid1
'dimensions of a variable, based on number of colums
ReDim RowContents(.Col)

'All the cells of a row are read into RowContents variable and then
'put into a database. After one row is processed, we proceed to the
'next one
For i = 0 To .Row
.Row = i
For j = 0 To .Col
.Col = j
RowContents(j) = .Text
Next j

With reSt

!AccID = NewRecordID
!AccNo = Format(RowContents(1))
!AccName = Format(RowContents(2))
!Type = Format(RowContents(3))
!Debit = Format(RowContents(4))
!Credit = Format(RowContents(5))

End With

Next i
End With

Thanks for your helpp and support