Number of records in recordset on form (VBA)

A

Al Campagna

Vsn,
On my website (below), I have a sample 97 and 2003 file
called Record Statistics.
It shows how to display all the info you want about the
current recordset... whether filtered or not.
Records = 1 of 250 of 250
would indicate that this is record 1 of 250 of 250
If I filter out 50 records, it then displays...
Records = 1 of 200 of 250
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."
 
V

Vsn

Hi all,

Can someone tell me how I can get the number of records holded in the
recordset from with in VBA?

Something as:- intMax = me.recordcount

Thx,
Ludovic

--
 
J

John W. Vinson

Hi all,

Can someone tell me how I can get the number of records holded in the
recordset from with in VBA?

Something as:- intMax = me.recordcount

Thx,
Ludovic

Me.RecordSetClone.RecordCount

should do it for you...
 
D

David W. Fenton

Me.RecordSetClone.RecordCount

should do it for you...

Well, except when it doesn't -- if checked during the form's OnLoad
event, it won't be accurate at first (for the same reason that no
recordset's recordcount can ever be counted on to be accurate) --
you need a:

Me.RecordSetClone.MoveLast

for the .RecordCount to be accurate.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top