Teach MeShow MeLet Me TryPrint

Adding a Calculated Control to a Report Section

A calculated control is a text control that uses an expression to calculate a value based on other values in the report. Create a calculated control by adding an unbound text control to the report. Type the expression to be calculated in the text control.

To add a calculated control:

  1. Add a new unbound text control to the report by clicking the Text Box button in the Toolbox. Click the place in the report where you want the new control to appear.
  2. Change the label text by right-clicking on the label and selecting Properties. Type the new label text in the Caption: box. Close the properties dialog by clicking the close box in the upper right corner.
  3. Click the text control box once to select it, then click again and type the expression to be calculated. Be careful not to double-click.
  4. Start the expression with the = sign.
  5. If your expression includes a function like SUM or COUNT, be sure to include parentheses around the values. For example, the expression =SUM([TotalOrders]) would calculate the total of all the total orders fields.
  6. If your expression includes field names, be sure to enclose the field name in brackets. For example, =[ProductsOrdered]-[ProductsSold] would calculate the value of the ProductsOrdered field minus the ProductsSold field.
  7. Press Enter when you are finished typing the expression.
  8. Switch to Preview view to see the results of the new calculated control.

Use the Expression Builder to create complex expressions.
Which part of the report you add the calculated control to determines which fields it can calculate. For example, you can add a calculated control that displays totals or averages for all records in the report to the report footer since the footer references all records. To add a calculated control that figures a value based on values that are specific to each record, place the control in the details section.
Common calculated controls include these functions: