Count number of records in all tables in a database

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello, how do I count the number of records in all tables in a certain
database. I need a list with table name and count.

Thanks in advance.

George
 
George wrote in message
Hello, how do I count the number of records in all tables in a
certain database. I need a list with table name and count.

Thanks in advance.

George

dim td as dao.tabledef
for each td in currentdb.tabledefs
debug.print td.name, td.recordcount
next td

Hit ctrl+g to see the results. Note - to avoid showing system tables
etc
you might consider testing whether left$(td.name, 4) <> "MSYS", and I
think the linked tables might show -1.
 
George wrote in message
Roy, I'm new to Access. I do not want the system tables in the count
where do but the left$(td.name, 4) <> "MSYS" in the code. Thanks
Again

Perhaps something like this:

dim td as dao.tabledef
for each td in currentdb.tabledefs
if left$(td.name, 4) <> "MSYS" then
debug.print td.name, td.recordcount
end if
next td
 
Roy, I'm new to Access. I do not want the system tables in the count where
do but the left$(td.name, 4) <> "MSYS" in the code. Thanks Again
 
Thank you

RoyVidar said:
George wrote in message


Perhaps something like this:

dim td as dao.tabledef
for each td in currentdb.tabledefs
if left$(td.name, 4) <> "MSYS" then
debug.print td.name, td.recordcount
end if
next td
 
Back
Top