PC Review


Reply
Thread Tools Rate Thread

Count # of records in a table..

 
 
Steve P
Guest
Posts: n/a
 
      15th Jan 2010
Hi, I just need a simple chunk of code that returns the total number of
records on a given table without any filtering...sounds easy enough i
thought...lol.
 
Reply With Quote
 
 
 
 
John Spencer
Guest
Posts: n/a
 
      15th Jan 2010
Simplest thing is

DCount("*","NameOfYourTable")
that works for local tables and linked tables.

If the tables are not linked but are in the database, this is probably the
fastest way to get a count.

CurrentDB().TableDefs("NameOfYourTable").RecordCount

John Spencer
Access MVP 2002-2005, 2007-2010
The Hilltop Institute
University of Maryland Baltimore County

Steve P wrote:
> Hi, I just need a simple chunk of code that returns the total number of
> records on a given table without any filtering...sounds easy enough i
> thought...lol.

 
Reply With Quote
 
John W. Vinson
Guest
Posts: n/a
 
      15th Jan 2010
On Fri, 15 Jan 2010 12:39:01 -0800, Steve P <(E-Mail Removed)>
wrote:

>Hi, I just need a simple chunk of code that returns the total number of
>records on a given table without any filtering...sounds easy enough i
>thought...lol.


DCount("*", "[name of the table]")

will do it...
--

John W. Vinson [MVP]
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Count records in a table? mscertified Microsoft Access Form Coding 1 22nd Apr 2008 12:41 AM
count records in table Etayki Microsoft VB .NET 1 20th Apr 2007 12:14 AM
Count records from different table =?Utf-8?B?TmF0aGFu?= Microsoft Access Forms 2 30th Mar 2007 07:53 PM
Count records in a table =?Utf-8?B?TmljaG9sYXMgU2NhcnBpbmF0bw==?= Microsoft Access VBA Modules 10 9th Jan 2006 08:46 AM
How to Count records in a table Greg Microsoft Access Queries 1 19th Nov 2003 07:38 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:33 PM.