An AccessObjectProperty object represents a built-in or user-defined characteristic of an AccessObject object.
Remarks
Every AccessObject object contains an AccessObjectProperties collection that has AccessObjectProperty objects corresponding to the properties of that AccessObject object. The user can also define AccessObjectProperty objects and append them to the AccessObjectProperties collection of some AccessObject objects.
You can create user-defined properties for the following objects:
CurrentProject and CodeProject object collections | Code data and CodeProject object collections |
---|---|
AllForms | AllTables |
AllReports | AllQueries |
AllDataAccessPages | AllViews |
AllMacros | AllStoredProcedures |
AllModules | AllDatabaseDiagrams |
To add a user-defined property, use the Add method to create and add an AccessObjectProperty object with a unique Name property setting and Value property of the new AccessObjectProperty object to the AccessObjectProperties collection of the appropriate object. The object to which you are adding the user-defined property must already be appended to a collection. Referencing a user-defined AccessObjectProperty object that has not yet been appended to an AccessObjectProperties collection will cause an error, as will appending a user-defined AccessObjectProperty object to an AccessObjectProperties collection containing an AccessObjectProperty object of the same name.
You can delete user-defined properties from the AccessObjectProperties collection.
Note A user-defined AccessObjectProperty object is associated only with the specific instance of an object. The property isn't defined for all instances of objects of the selected type.
The AccessObjectProperty object has two built-in properties:
To refer to a built-in or user-defined AccessObjectProperty object in a collection by its ordinal number or by its Name property setting, use any of the following syntax forms:
CurrentProject.AllForms("Form1").Properties(0)
CurrentProject.AllForms("Form1").Properties("name")
CurrentProject.AllForms("Form1").Properties![name]
With the same syntax forms, you can also refer to the Value property of a AccessObjectProperty object. The context of the reference will determine whether you are referring to the AccessObjectProperty object itself or the Value property of the AccessObjectProperty object.
Note Properties in the AccessObjectProperties collection are not stored and can be lost when when the object they are associated with is checked in or out using the Source Code Control add-in.