contents.gifindex.gifprev1.gifnext0.gif

Identifier Operators

Purpose

The ! and .(dot) identifier operators show the relationships among the fields, controls, and properties (elements) in an identifier. These operators indicate that one identifier element belongs to another.

Notes

The ! operator is always followed by the name of a user-defined item, such as the forms, reports, controls, and fields you create. It indicates that the item is an element of a collection. The .(dot) operator is usually followed by a property name.

The expression in the following example refers to the value of the Order Date field or control on the Orders form, which belongs to the Forms collection:

Forms![Orders]![Order Date]

This expression refers to the Visible property of the Customers form:

Forms![Customers].Visible

You can use the .(dot) operator to refer to a field value in an SQL statement, or if another table in a query or filter has a field with the same name. In Access Basic modules, you also use the .(dot) operator to refer to methods.

You can enclose an object name in parentheses and quotation marks (" ") instead of using the ! operator. The following examples are equivalent:

Forms![Orders]![Order Date]

Forms("Orders")("Order Date")

Use the parenthesis syntax in Access Basic modules when you want to use a variable in an identifier.

In Access Basic, you can also use the recordset variables to refer to the value of a field.