George wrote in message
<A4A5DDF2-A999-468F-9597-(E-Mail Removed)> :
> 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
>
> "RoyVidar" wrote:
>
>> George wrote in message
>> <891DE1F0-9078-40D7-8E2D-(E-Mail Removed)> :
>>> 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.
>>
>> --
>> Roy-Vidar
>>
>>
>>
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-Vidar
|