I\'m quering the table MsysObjects for making a list of the objects in my database:
SELECT MsysObjects.Name, MsysObjects.Type
FROM MsysObjects
WHERE (((Left$
FWIW - IIF is a drag, and the switch solution doesn't seem valid for SQL (I may have done something wrong). I entered the values that Fionnuala offered into a new table named AccessObjectXref:
ID ObjectType ObjectDesc
1 -32768 Form
2 -32766 Macro
3 -32764 Report
4 -32761 Module
5 -32758 Users
6 -32757 DB Document
7 1 Table
8 2 DB
9 3 Container
10 5 Query
11 8 Subdatasheet
Then used the following SQL to create a list of object names and their counts. Obviously you could include every record if you wanted:
SELECT objectdesc, Count(*) AS Expr1
FROM msysobjects, AccessObjectTypeXref where type = objecttype
group by objectdesc order by objectdesc