• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 4. Calculation Fields > Formatting Labels or Envelopes

Formatting Labels or Envelopes

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.

To create a label field

1.
Choose File > Define > Database (Control+Shift+D/Command+Shift+D).

2.
Click the Fields tab. Type the name you'll 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 60—in 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).

Figure 4.22. To put the first field on a line of its own, put a paragraph symbol between quotes.


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).

Figure 4.23. Use the Trim function to delete extra spaces around the address line.


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).

Figure 4.24. To insert a comma between two fields, use the quotes button and type a comma and a space inside the quotes.


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).

Figure 4.25. To string City, State, and Zip together on one line, use ampersands (&) between functions and don't insert the paragraph symbol.


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.

✓ Tip

  • If your addresses will sometimes include a country but not always, use the If function combined with IsEmpty to add the Country field as the last line of the formula. For information on how to do this, see steps 7–11 in “To combine fields” on page 60 (Figure 4.26).

    Figure 4.26. To add a Country line to a label, select the If function, and use IsEmpty to test the results. If the field is empty, no extra line is inserted. If it contains data, the calculation will add a paragraph marker and the field contents.


  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint