record counts

N

NH

I want to have a 'control panel' form which amongst other things will
display record counts for each table.

Down one side of the form I want text boxes displaying current record
counts:

Table1 : 743258
Table2: 326546
Table3: 324524

Is there an easy way of doing this, or do I have to use subforms?

Thanks

Nick
 
G

Gerald Stanley

Put a text box on the form for each row count and set the
ControlSource to =DCount(1,"{tablename}","")

You would have to replace {tablename} including {} with the
table names from your application.

Hope This Helps
Gerald Stanley MSCD
 
C

Cheryl Fischer

The following SQL will run a query against the MSysObjects table to get
table names and the DCount function will return recordcounts for each of
those tables.

SELECT MSysObjects.Name AS TableName, DCount("*",[name]) AS RecordCount
FROM MSysObjects
WHERE (((MSysObjects.Name) Not Like "msys*") AND ((MSysObjects.Type)=1))

You can use this SQL as the RecordSource of a form.

hth,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top