Form, Report Properties

Applies To

Form, Report.

Description

You can use the Form and Report properties to refer to a form or report, or 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 in a macro or in 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 subOrderDetails subform control.


Dim intOrderID As Integer= Forms!Orders![subOrderDetails].Form![OrderID]

The next example calls a function from a property sheet 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.

See Also

ActiveForm Property, ActiveReport Property, Forms Collection, Me Property, Parent Property, Reports Collection.

Example

The following example uses the Form and Report properties to refer to a control on a subform and a subreport.


Dim curTotalAmount As CurrencycurTotalSales As Currency= Forms![Orders]![OrderDetails].Form![TotalAmount]= Reports![Sales]![Employees].Report![TotalSales]