Count of objects in Navigation Pane

  • Thread starter Thread starter mark909
  • Start date Start date
M

mark909

Ive got quite alot of queries and reports with subreports in my database now.

Is there anyway of getting a count of these?
 
On Mon, 6 Apr 2009 06:55:01 -0700, mark909

Yes. All objects are in the Documents collection. Look it up in the
help file. Then write code like this:
Dim c As DAO.Container
For Each c In CurrentDb.Containers
Debug.Print "Container=" & c.Name & ", Count=" & c.Documents.Count
Next c

-Tom.
Microsoft Access MVP
 
Try these queries ...

SELECT Type, Name FROM MSysObjects ORDER BY Type, Name

SELECT MSysObjects.Type, Count(MSysObjects.Type) AS Total
FROM MSysObjects
GROUP BY MSysObjects.Type
ORDER BY MSysObjects.Type, Count(MSysObjects.Type);



ObjectTypeID ObjectType
-32768 Form
-32766 Macro
-32764 Report
-32761 Module
1 Table
4 Table
5 Query
6 Table

Where 1 is a local table and 4 is a linked table.
 
Danny said:
SELECT MSysObjects.Type, Count(MSysObjects.Type) AS Total
FROM MSysObjects
GROUP BY MSysObjects.Type
ORDER BY MSysObjects.Type, Count(MSysObjects.Type);

He might prefer to exclude system tables and temporary objects
from his counts.

SELECT m.[Type] AS obj_type, Count(m.[Type]) AS CountOfType
FROM MsysObjects AS m
WHERE (((m.[Name]) Not ALike '~%' And (m.[Name]) Not ALike 'MSys%'))
GROUP BY m.[Type]
ORDER BY m.[Type];
 
Back
Top