Form, Report Properties

Form, Report Properties

See Also         Example         Applies To

You can use the Form and Report properties to refer to a form or report or to refer to the form or report associated with a subform control or subreport control.

Setting

These properties refer to a form or report object. They are read-only in all views.

You can use these properties by using a macro or Visual Basic.

Remarks

These properties are typically used to refer to the form or report contained in a subform or subreport control. For example, the following code uses the Form property to access the OrderID control on a subform contained in the OrderDetails subform control.

Dim intOrderID As Integer
intOrderID = Forms!Orders!OrderDetails.Form!OrderID

The next example calls a function from a property sheet by using the Form property to refer to the active form that contains the control named CustomerID.

=MyFunction(Form!CustomerID)

When you use the Form property in this manner, you are referring to the active form, and the name of the form isn't necessary.

The next example is the Visual Basic equivalent of the preceding example.

X = MyFunction(Forms!Customers!CustomerID)

Note   When you use the Forms or Reports collection, you must specify the name of the form or report.