When you create a report, you might want to include summary information or other calculations. The wizards often include built-in functions, but you can use the Expression Builder to create your own by clicking buttons for the arithmetic operators you want to use and including constant values as needed. For example, if you want to determine bonuses based on a percentage of sales, you can create an arithmetic expression to compute the results. When you generate the report, Access will perform the required calculations and display the results in the report. To display the calculations in the appropriate format, you can also use the Properties feature to specify formats for dates, currency, and other numeric data.
Choose Fields to Use in a Calculation
|
In Design view, create a text box control and position it where you want the calculated field to appear, or select an existing unbound control.
|
|
Click the Properties button on the Report Design toolbar.
|
|
Click the Control Source property box, which specifies what data appears in a control, and then click the Expression Builder button.
|
|
Click the equal sign (=) button.
|
|
Enter the values and operators you want to use.
|
Click operator buttons to supply the most common operations.
Double-click folders in the left pane to open lists of objects you can use in your expression, including existing fields, constants, operators, and common expressions.
Manually type an expression.
|
Click OK to insert the calculation.
|
|
Click the Close button.
|
Format Values in a Report
|
In Design view, position the insertion point in the field whose format you want to change, and then click the Properties button on the Report Design toolbar.
|
On either the All tab or the Format tab of the property sheet, click the Format property box, click the list arrow that appears, and then click the format you want to use.
The names of the formats appear on the left side of the drop-down list, and examples of the corresponding formats appear on the right side.
|
If you are formatting a number (rather than a date), and you do not want to accept the default, "Auto", click the Decimal Places property box, click the list arrow, and then click the number of decimal places you want.
|
|
Click the Close button.
|
You can use a builder. Access makes it easy to change many types of settings by providing builders, or tools that simplify tasks. The Expression Builder is just one of many builders in Access. You know a builder is available for a task when you click a property box and a Build button appears.
|
|