G.2. AllObjects Collection

Access contains a hidden collection called the AllObjects collection. Chances are you'll never use this collection directly, but it happens to be the parent object of several collections that are commonly used. These collections are:

CollectionDescription
AllDatabaseDiagramsContains an object for each database diagram in a SQL Server database. Applies to ADP files only.
AllFormsContains an object for each form in a database or project file.
AllFunctionsContains an object for each user-defined function in a SQL Server database. Applies to ADP files only.
AllMacrosContains an object for each macro in a database or project file.
AllModulesContains an object for each module in a database or project file.
AllQueriesContains an object for each query in an Access database (ACCDB or MDB).
AllReportsContains an object for each report in a database or project file.
AllStoredProceduresContains an object for each stored procedure in a SQL Server database. Applies to ADP files only.
AllTablesContains an object for each table in a database or project file.
AllViewsContains an object for each view in a SQL Server database. Applies to ADP files only.

Each of these collections contains AccessObject objects that are described in a later section. Because these collections all derive from the AllObjects collection, they have the same properties and methods. For example, take a closer look at the AllForms collection.

As its name implies, the AllForms collection contains an Access ...

Get Access™ 2007 VBA Programmer's Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.