Calculation fields can be combined with other fields to build more complex formulas. For example, once you have a Full Name calculation field, you can combine it with the address data to create a label field. This field can become a building block for every layout that requires these fields to be used together. Not only will it make a label easy to position for printing, but the same field works nicely as a letter heading or Sold To field in an invoice. Just adjust the field fonts and sizes in each layout.
1 .Choose File > Define > Database (Control+Shift+D/Command+Shift+D).
2 .Click the Fields tab. Type the name youll use for your label field in the Field Name text box, select Calculation in the Type drop-down list, then click Create. We use Label as the field name in this example.
3 .When the Specify Calculation box appears, double-click the name of the full name calculation field you created in "To combine fields" on page 60in our case, Full Name. In the Operators keypad, click the ampersand (&) button.
4 .In the Operators keypad, click the quotes button and then the paragraph (¶) button (Figure 4.22).
5 .Click to the right of the quotes, then click the ampersand button and press Return (Mac) or Enter (Windows).
6 .In the function list on the right, double-click Trim.
7 .With the "text" parameter highlighted in the formula box, double-click the next field to be used in the calculation. This example uses the Address field (Figure 4.23).
8 .Click to the right of the parentheses. In the Operators keypad, click the ampersand (&) button. Click the quotes button and then the paragraph (¶) button.
9 .Next you want to put the Address field on its own line in the label. Click to the right of the quotes, then click the ampersand button and press Return (Mac) or Enter (Windows).
10 .In the function list, double-click Trim. Replace the "text" parameter by double-clicking City in the field list.
11 .Click to the right of the parentheses. Click the ampersand button, then click the quotes button. Type a comma and a space inside the quotes. Click to the right of the quotes and click the ampersand button (Figure 4.24).
12 .In the function list, double-click Trim. Replace the "text" parameter by double-clicking State in the field list. Click to the right of the parentheses, and click the ampersand button in the Operators keypad.
13 .Click the quotes button and type a space inside the quotes to add a space before the next field. Click to the right of the quotes and click the ampersand button.
14 .In the function list, double-click Trim. Replace the "text" parameter by double-clicking Zip in the field list (Figure 4.25).
15 .Set "Calculation result is" to Text and click OK twice to finish. Now you have a completed formula for a calculation field. When you place this field in a layout, it will display three lines of text: the full name and two address lines.
To combine fields" on page 60 (Figure 4.26).