Count # of records in a table..

  • Thread starter Thread starter Steve P
  • Start date Start date
S

Steve P

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.
 
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
 
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...
 
Back
Top