Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / May 2008

Tip: Looking for answers? Try searching our database.

Number of records in recordset on form (VBA)

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Vsn - 14 May 2008 13:29 GMT
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

Signature

-------------------------------
This e-nonsense has been sent using a Strawberry.
-------------------------------

Al Campagna - 14 May 2008 14:14 GMT
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
Signature

   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."

> Hi all,
>
[quoted text clipped - 5 lines]
> Thx,
> Ludovic
John W. Vinson - 14 May 2008 17:56 GMT
>Hi all,
>
[quoted text clipped - 5 lines]
>Thx,
>Ludovic

Me.RecordSetClone.RecordCount

should do it for you...
Signature


            John W. Vinson [MVP]

David W. Fenton - 15 May 2008 02:33 GMT
>>Hi all,
>>
[quoted text clipped - 9 lines]
>
> 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.

Signature

David W. Fenton                  http://www.dfenton.com/
usenet at dfenton dot com    http://www.dfenton.com/DFA/

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.