I have some code as follows: to insert a recordset into an array and then loop through it.
The problem I have, is that intcount = 501 so I would expect iRecLast to be 500 (or thereabouts) but it is always 0.
I then use, this to loop through the array.
This loops 1 time and then arData(0,1) returns <subscript out of range>
I have been at this for hours and I can't get the recordset into the array,
Any ideas?
Thanks
Brian
Code:
sSQL = "SELECT imagename FROM tblproducts "
Set rstimage = CurrentDb.OpenRecordset(sSQL)
If Not rstimage.EOF Then arData = rstimage.GetRows()
intCount = rstimage.RecordCount
iRecFirst = LBound(arData, 2)
iRecLast = UBound(arData, 2)
rstimage.Close
Set rstimage = Nothing
I then use, this to loop through the array.
Code:
For i = iRecFirst To iRecLast
If Left(strBaseName, 13) = arData(0, i) Then
boofound = True
End If
Next i
I have been at this for hours and I can't get the recordset into the array,
Any ideas?
Thanks
Brian