AccessObjectProperty object (Access)
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:
CodeData, CodeProject, CurrentProject, and CurrentData objects
AccessObject objects in the following collections:
CurrentProject and CodeProject object collections:
CodeData and CodeProject object collections:
Note
The AccessObjectProperties collection isn't accessible for objects derived from the CurrentData object (for example, CurrentData.AllTables!Table1). For objects derived in this manner, you can only access their built-in properties by direct calls to the desired property (for example, CurrentData.AllTables!Table1.Name).
To add a user-defined property, use the Add method to create and add an AccessObjectProperty object with a unique Name property and Value property. 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 by using the Remove method.
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:
- The Name property, a String that uniquely identifies the property.
- The Value property, a Variant that contains the property setting.
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 an AccessObjectProperty object. The context of the reference will determine whether you are referring to the AccessObjectProperty object itself or to the Value property of the AccessObjectProperty object.
Note
Properties in the AccessObjectProperties collection are not stored and can be lost when the object they are associated with is checked in or out by using the Source Code Control add-in.
Properties
See also
Support and feedback
Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.