Access Reference

Call procedures in a subform or subreport

Direct Answer

Call procedures in a subform or subreport
is part of the Access VBA object model. This reference page documents its syntax, parameters, and typical usage.

Reference

You can call a procedure in a module associated with a subform or subreport in one of two ways. If the form containing the subform is open in Form view, you can refer to the procedure as a method on the subform.

The following example shows how to call the procedure GetProductID in the Orders subform, which is bound to a subform control on the Orders form:

In the Orders Subform class module, enter this code:

vb
Public Function GetProductID() As Variant
' Return current productID.
GetProductID = ProductID
End Function

The following code illustrates how to call the GetProductID procedure.

vb
Forms!Orders![Orders Subform].Form.GetProductID

!include[Support and feedback]

Reference: Access object-model documentation • updated 09/21/2018
. Rebuilt for readability; see the original for complete parameter matrices.