Microsoft Office Tutorials and References
In Depth Information
Session 3.2
query that contains a calculated field, Access evaluates the expression defined by the calcu-
lated field and displays the resulting value in the query datasheet, form, or report.
Creating a Calculated Field
To produce the information Elsa wants, you need to open the HighWageAmounts query
and create a calculated field that will multiply each Wage field value by each
HoursPerWeek value, and then multiply that amount by .02 to determine the 2% weekly
bonus Elsa is considering.
To enter an expression for a calculated field, you can type it directly in a Field text box
in the design grid. Alternately, you can open the Zoom box or Expression Builder and use
either one to enter the expression. The Zoom box is a large text box for entering text,
expressions, or other values. To use the Zoom box, however, you must know all the parts
of the expression you want to create. Expression Builder is an Access tool that makes it
easy for you to create an expression; it contains a box for entering the expression, buttons
for common operators, and one or more lists of expression elements, such as table and
field names. Unlike a Field text box, which is too small to show an entire expression at
one time, the Zoom box and Expression Builder are large enough to display lengthy
expressions. In most cases, Expression Builder provides the easiest way to enter expres-
sions, because you don’t have to know all the parts of the expression; you can choose the
necessary elements from the Expression Builder dialog box.
Using Expression Builder
Reference Window
Open the query in Design view.
In the design grid, position the insertion point in the Field text box of the field for which
you want to create an expression.
Click the Build button on the Query Design toolbar.
Use the expression elements and common operators to build the expression, or type the
expression directly.
Click the OK button.
You’ll begin by copying, pasting, and renaming the HighWageAmounts query, keeping
the original query intact. You’ll name the new query “HighWagesWithBonus.” Then you’ll
modify this query in Design view to show only the information Elsa wants to view.
To copy the HighWageAmounts query and paste the copy with a
new name:
1. Right-click the HighWageAmounts query in the list of queries, and then click Copy on the
shortcut menu.
2. Right-click an empty area of the Database window, and then click Paste on the shortcut
menu. The Paste As dialog box opens.
3. Type HighWagesWithBonus in the Query Name text box, and then press the Enter key.
The new query appears in the query list, along with the original HighWageAmounts query.
Now you’re ready to modify the HighWagesWithBonus query to create the calculated
field for Elsa.
Search JabSto ::

Custom Search