Re: Recordset.RecordCount is wrong ??



Nikos,

Thanks for the quick response.

I have done what you suggested and it does correct the value in the
recordcount, thank you.

Regards,

Steve Perrins



"Nikos Yannacopoulos" <nyannacoREMOVETHIS@xxxxxxxxx> wrote in message
news:%23AJFbi7rGHA.4004@xxxxxxxxxxxxxxxxxxxxxxx
Steve,

This is a VBA / DAO bug, I believe... to get the correct recordcount, you
need to force a move away from the first record first. Try:

rs.MoveLast
rs.MoveFirst
MyVal = rs.RecordCount

to get the correct number.

HTH,
Nikos


.



Relevant Pages

  • Easier / different way to do this
    ... I now use a DAO connection SQL statement, and recordcount to check to ... see if a number the user has input into a textbox is already in the ... built in features of Access when I revert to using VBA. ...
    (comp.databases.ms-access)
  • RE: Run-time Error 3704 in VB6
    ... I found when using vba, that if you call the recordcount, you must first ... movelast. ... dim rc as integer ...
    (microsoft.public.data.ado)
  • Re: Easier / different way to do this
    ... It is bad practice to rely on the recordcount property. ... WHERE SomeCriteria ... >I now use a DAO connection SQL statement, ... > built in features of Access when I revert to using VBA. ...
    (comp.databases.ms-access)
  • Re: Recordset.RecordCount is wrong ??
    ... This is a VBA / DAO bug, ... to get the correct recordcount, you need to force a move away from the first record first. ...
    (microsoft.public.access.modulesdaovba)
  • Re: Number of records in recordset on form (VBA)
    ... John W. Vinson wrote in ... the recordset from with in VBA? ... for the .RecordCount to be accurate. ...
    (microsoft.public.access.formscoding)