recourdcount acting strangely

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

Guest

Hey everyone

I have a subform to a filtered form in Access 2002 for a
2k database. The subform has an OnCurrent event that
involves calling Me.RecordsetClone.RecordCount. However,
when the form first loads, regardless of what the number
of records should be, the value of recordcount is always
1. I added me.RecordsetClone to the watch, and the
member "Recordcount" actually does give the correct value
at the time the Recordcount method is called, but the
Me.RecordsetClone.RecordCount I added to the watch always
givs the value of 1. I'm completely stumped, so any help
is greatly appreciated.

TIA

Chris
 
The RecordCount of a DAO Recordset indicates the number of records accessed
so far. Immediately after load, this will be 0 if there are no records, or 1
if there are (since we have only loaded the first record at that point).

To force the full count, you can move to the last record in the recordset:
With Me.RecordsetClone
If .RecordCount > 0 Then
.MoveLast
MsgBox "Records: " & .RecordCount
End If
End With
 
Back
Top