.recordcount error

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a module that runs a query multiple times with different parameters
each timethe query runs I need to know how many records are in the query, I'm
trying to do this withe the recordcount property but I have found that the
property returns the wrong value, there is an artical in the knowledgebase
about this and I applied the fix it reccomended as shown below:

With QD.OpenRecordset()
.MoveLast
recordcountright = .recordcount

QD is my query, It works fine but from time to time the query won't return
any records and the Movelast method will generate an error saying there is no
current record. Any ideas on how I could work arround this?
 
chessley said:
I have a module that runs a query multiple times with different
parameters each timethe query runs I need to know how many records
are in the query, I'm trying to do this withe the recordcount
property but I have found that the property returns the wrong value,
there is an artical in the knowledgebase about this and I applied the
fix it reccomended as shown below:

With QD.OpenRecordset()
.MoveLast
recordcountright = .recordcount

QD is my query, It works fine but from time to time the query won't
return any records and the Movelast method will generate an error
saying there is no current record. Any ideas on how I could work
arround this?

With QD.OpenRecordset()
If Not .EOF Then .MoveLast
recordcountright = .recordcount
' ...
End With
 
chessley said:
I have a module that runs a query multiple times with different parameters
each timethe query runs I need to know how many records are in the query, I'm
trying to do this withe the recordcount property but I have found that the
property returns the wrong value, there is an artical in the knowledgebase
about this and I applied the fix it reccomended as shown below:

With QD.OpenRecordset()
.MoveLast
recordcountright = .recordcount

QD is my query, It works fine but from time to time the query won't return
any records and the Movelast method will generate an error saying there is no
current record. Any ideas on how I could work arround this?


With QD.OpenRecordset()
If .RecordCount > 0 Then .MoveLast
recordcountright = .recordcount
 
Back
Top