RecordCount Not Counting Correctly

  • Thread starter Jeff via AccessMonster.com
  • Start date
J

Jeff via AccessMonster.com

I have the following code but it's not counting all my records. Any ideas?

Me.Recordset.MoveLast
Me.Recordset.MoveFirst

Me.HowManyRecords = Me.Recordset.RecordCount
 
S

Sylvain Lafontaine

Maybe you have a local or a server filter on your form.

I'm not sure here but the recordsets used by ADP are client recordset with
no server cache, so there is no need to use Me.Recordset.MoveLast and
Me.Recordset.MoveFirst before accessing the property RecordCount.
 
A

Alex White MCDBA MCSE

If you open in code

e.g.

dim adoTest as new adord.recordset
with adoTest
.open "Select * from
TblTest",currentproject.connection,adopenkeyset,adlockreadonly
msgbox .recordcount
.close
end with

will give you the correct record count it's down to the adopenkeyset

why not create a function to just to return the record count,
 
Top