Examples of using domain aggregate functions on forms and reports

Examples of using domain aggregate functions on forms and reports

The following table lists examples of expressions you can use in calculated controls on forms and reports.

Expression Description
=DLookup("[ContactName]", "[Suppliers]", "[SupplierID] = Forms![SupplierID]") Uses the DLookup function to display the value of the ContactName field in the Suppliers table where the value of the SupplierID field in the table matches the value of the SupplierID control on the active form.
=DLookup("[ContactName]", "[Suppliers]", "[SupplierID] = Forms![New Suppliers]![SupplierID]") Uses the DLookup function to display the value of the ContactName field in the Suppliers table where the value of the SupplierID field in the table matches the value of the SupplierID control on the New Suppliers form.
=DSum("[OrderAmount]", "[Orders]", "[CustomerID] = 'RATTC'") Uses the DSum function to display the sum total of values of the OrderAmount field in the Orders table where the CustomerID is RATTC.

Notes