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$([Name],1))<>'~') AND ((Left$([Name],4))<>'Msys'))
ORDER BY MsysObjects.Name;
I know the meaning of this values:
-32768 = Form
-32766 = Macro
-32764 = Report
-32761 = Module
1 = Table
5 = Query
6 = Linked Table
But what about -32758, -32757 and 3? Where do they stand for? Cannot find it on the web.
-- http://www.access-programmers.co.uk/forums/showthread.php?t=103811
I'd tend to avoid mucking about with the system tables. For one, temporary objects can show up there and confuse things. To get the same information, you can use:
That's the documented way to get the information. Depending on undocumented system tables is not recommended.
Re David Fenton's proper answer above, here is Microsoft documentation of those techniques. There appear to be two distinct object models for Access:
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:
Then used the following SQL to create a list of object names and their counts. Obviously you could include every record if you wanted:
Step 1 Create table "AccessObjectType" Columns:
Populate the "AccessObjectType" table:
If you like, you can create another column called "SimpleType" for grouping of 1, 4 and 6 as simple type Table.
Step 2 Create Query "AccessObjectQ" SQL:
Step 3 Create a table "AccessObjectVisibility" Columns:
You can now easily open this table (or a query) and select objects that you want users and admins to see in automatically populated lists you provide on forms.
Step 4 Create Query "UserAccessObject"
Create Query "UserAccessForm"
Create queries: "UserAccessReport", "UserAccessQuery", "UserAccessMacro", etc.
Step 5" Create a custom reports menu using query "UserAccessReport" to populate a list box or combo box