Object Properties

Applies To

Form object, Module object, Report object.

Description

The Object properties provide general information about objects contained in the Database window.

Setting

You can view the Object properties, and set the Description or Attributes properties, in the following ways:

  • Click an object in the Database window, and then click the Properties button on the Database toolbar.
  • Click an object in the Database window, and then click Properties on the View menu.
  • Right-click an object in the Database window, and then click Properties on the shortcut menu.
You can also specify or determine the Object properties by using Visual Basic.

Note You can only enter or edit the Description and Attributes properties. The other Object properties are set by Microsoft Access and are read-only.

Remarks

The objects in the Database window are tables, queries, forms, reports, macros, and modules. Each class of objects in the database is represented by a separate Document object within the Containers collection. For example, the Containers collection contains a Document object that represents all the forms in the database.

The following Object properties are available from the Database window.

Property

Description

Name

This is the name of the object and contains the setting from the object's Name property.

Type

This is the object's type. Microsoft Access object types are Form, Macro, Module, Query, Report, and Table.

Description

This is the object's description and is the same as the setting for the object's Description property. For tables and queries, you can also set the object's Description property in the object's property sheet. An object's description also appears next to the object's name in the Database window if you click Details on the View menu.

Created

This is the date that the object was created. For tables and queries, this property is the same as the DateCreated property.

Modified

This is the date that the object was last modified. For tables and queries, this property is the same as the LastUpdated property.

Owner

This is the owner of the object. For more information, see the Owner property.

Attributes

This property specifies whether the object is hidden or visible and whether the object can be replicated in a database replica.

If you set the Hidden attribute to True (by selecting the Hidden check box), the object won't appear in the Database window. To display hidden objects in the Database window, click Options on the Tools menu, click the View tab, and then select the Hidden Objects check box. The icons for hidden objects will be dimmed in the Database window. You can then turn the Hidden attribute off, making the objects visible in the Database window.


See Also

Containers collection ("DAO Language Reference"), DateCreated, LastUpdated properties ("DAO Language Reference"), Description property, Description property ("DAO Language Reference"), Document object ("DAO Language Reference"), Documents collection ("DAO Language Reference"), Name property, Name property ("DAO Language Reference"), Owner property ("DAO Language Reference").

Example

The following example uses the PrintObjectProperties subroutine to print the values of an object's Object properties to the Debug window. The subroutine requires the object type and object name as arguments.

Dim strObjectType As String
Dim strObjectName As String
Dim strMsg As String

strMsg = "Enter object type (e.g., Forms, Scripts, " _
    & "Modules, Reports, Tables)."
' Get object type.
strObjectType = InputBox(strMsg)
strMsg = "Enter the name of a form, macro, module, " _
    & "query, report, or table."
' Get object name from user.
strObjectName = InputBox(strMsg)
' Pass object type and object name to
' PrintObjectProperties subroutine.
PrintObjectProperties strObjectType, strObjectName

Sub PrintObjectProperties(strObjectType As String, strObjectName _
        As String)
    Dim dbs As Database, ctr As Container, doc As Document
    Dim intI As Integer
    Dim strTabChar As String
    Dim prp As Property

    Set dbs = CurrentDb
    strTabChar = vbTab
    ' Set Container object variable.
    Set ctr = dbs.Containers(strObjectType)
    ' Set Document object variable.
    Set doc = ctr.Documents(strObjectName)
    doc.Properties.Refresh
    ' Print the object name to Debug window.
    Debug.Print doc.Name
    ' Print each Object property to Debug window.
    For Each prp in doc.Properties
        Debug.Print strTabChar & prp.Name & " = " & prp.Value
    Next
End Sub