Hi,
I have a DAO.Recordset wich is filled with data from a query in Access. How can I know how many records there are in this recordset?
so far I have this:
[code=vb]
Dim strSQL As String
Dim i As Integer
Dim iNumCols, iNumRows As Integer
' This should be the final SQL cmd
strSQL = "SELECT * FROM SBB_General_Pur pose WHERE Datum BETWEEN " & ToDate & " AND " & TillDate & ";"
Set db = CurrentDb()
Set rs = db.OpenRecordse t(strSQL)
If Not rs.BOF And Not rs.EOF Then ' it has records
iNumCols = rs.Fields.Count
iNumRows = rs.RecordCount
[/code]
However, iNumRows stays at 1, so I guess this is the 1st record, not the total ammount of records. Anyone who knows a trick to get this number?
Thanks in advance,
Jasper
I have a DAO.Recordset wich is filled with data from a query in Access. How can I know how many records there are in this recordset?
so far I have this:
[code=vb]
Dim strSQL As String
Dim i As Integer
Dim iNumCols, iNumRows As Integer
' This should be the final SQL cmd
strSQL = "SELECT * FROM SBB_General_Pur pose WHERE Datum BETWEEN " & ToDate & " AND " & TillDate & ";"
Set db = CurrentDb()
Set rs = db.OpenRecordse t(strSQL)
If Not rs.BOF And Not rs.EOF Then ' it has records
iNumCols = rs.Fields.Count
iNumRows = rs.RecordCount
[/code]
However, iNumRows stays at 1, so I guess this is the 1st record, not the total ammount of records. Anyone who knows a trick to get this number?
Thanks in advance,
Jasper
Comment