Sub TestGetRows()
Dim varValues As Variant
Dim recSales As Recordset
Dim intRowCount As Integer
Dim intFieldCount As Integer
Dim i As Integer
Dim j As Integer
Set recSales = CurrentDb().OpenRecordset("tblSales")
varValues = recSales.GetRows(2)
recSales.Close
intFieldCount = UBound(varValues, 1)
intRowCount = UBound(varValues, 2)
For j = 0 To intRowCount
For i = 0 To intFieldCount
Debug.Print "Row " & j & ", Field " & i & ": ";
Debug.Print varValues(i, j)
Next
Next
End Sub
|