If youve created form-letter layouts before, you know that its relatively easy to use merge fields to personalize a standard letter. However, if you depend heavily on form letters, you still end up repeating the same tasks over and over when you use this tactic. Form letters usually follow the same basic concepta salutation (Dear), a courtesy title (Mr., Ms., General, or Exalted Leader), and a last name. Then comes the body of the text, followed by a closing (Sincerely) and a signature name. Replace many of these form-letter elements with calculation fields and you can minimize duplications.
If youre clever about creating options with the all-purpose If function, you can trim the number of different layouts and letters you need to create as well.
For example, if you have a Greeting Name field, you can set your salutation to automatically create either a formal or informal heading. Youd still use If and IsEmpty functions to check for text in a field (like the MI field), but substitute the Greeting Name field instead. If there is no text in the Greeting Name field, the salutation would default to the standard formal format (Dear Mrs. Jones). If it is supplied, the less formal greeting name (a first name or a nickname) would be used (Dear Karen).
One of the most useful next steps in putting the Label calculation field to work is using it in a letter layout. Most well-composed letters include the addressees name and address as a block of text (just like the label). Following that block of text is a date or a greeting line. Since the elements and their positions are standard, theyre a prime target for another modular calculation field.
You can adapt the techniques below to create layouts such as business forms, statements, invoices, and other printouts that combine global container fields with standard fields.
1 .Follow the steps in "To create a label field" on page 64.
2 .Choose File > Define > Database (Control+Shift+D/Command+Shift+D).
3 .Click the Fields tab. Type the name of your heading field in the Field Name text box, select Calculation in the Type drop-down list, then click Create. We use Letter Heading as the field name in this example.
4 .When the Specify Calculation box appears, double-click the name of your label calculation fieldin our example, Label. In the Operators keypad, click the ampersand button.
5 .In the Operators keypad, click the quotes button and then the paragraph button two or three times to create enough space between the heading address and the salutation. Click to the right of the quotes and click the ampersand button in the Operators keypad (Figure 4.27).
6 .In the Operators keypad, click the quotes button. Between the quotes type Dear and a space. Click to the right of the quotes. In the Operators keypad, click the ampersand button (Figure 4.28).
7 .In the field list, double-click your courtesy title field. This example uses MrMS.
8 .In the Operators keypad, click the ampersand button, then the quotes button. Type a space inside the quotes.
9 .Click to the right of the quotes and click the ampersand button again (Figure 4.29).
10 .In the function list, double-click Trim. With "text" highlighted in the formula box, double-click the Last Name field in the field list.
11 .Click to the right of the parentheses. In the Operators keypad, click the ampersand button, then the quotes. Type a colon inside the quotes.
12 .Be sure to select Text from the "Calculation result is" pull-down menu, then click OK twice to finish.
You now have a standard letter heading and greeting in one field.
Once you get the hang of the concept, you can start combining modules of calculation fields to help you streamline your layout creation. For example, many invoices have two address sections: the ship-to address and the bill-to address. Sometimes these addresses are the same, but occasionally theyre not. If you created one calculation field for the shipping address (usually the same as the label field), you can create another for a billing address. If the billing address exists, it will be inserted in the layout. If the billing calculation field is empty, the shipping address will be inserted instead.
1 .Follow the steps in "64.
2 .Choose File > Define > Database (Control+Shift+D/Command+Shift+D).
3 .Click the Fields tab. Type the name of your heading field in the Field Name text box, select Calculation from the Type drop-down list, then click Create. We use Letter Header as the field name in this example.
4 .When the Specify Calculation box appears, double-click the name of your label calculation fieldin our example, Label. In the Operators keypad, click the ampersand button.
5 .In the Operators keypad, click the quotes button and then the paragraph button two or three times to create the visual space youd like between the heading address and the letter salutation. Click to the right of the quotes again and click the ampersand button in the Operators keypad (Figure 4.30).
6 .Click the quotes button. Type Dear and a space between the quotes. Click to the right of the quotes. In the Operators keypad, click the ampersand button (Figure 4.31).
7 .Double-click If to choose it from the function list. In the formula box, double-click the "test" parameter in the If statement to select it. In the function list, double-click IsEmpty (Figure 4.32).
The IsEmpty function looks at a field to see if it contains any data.
8 .With the "field" parameter highlighted in the formula box, double-click Greeting Name in the field list (Figure 4.33).
9 .In the formula box, double-click "resultOne" to highlight it.
10 .Double-click the MrMS field in the field list.
11 .In the Operators keypad, click the ampersand button, then the quotes button. Type a space inside the quotes.
12 .Click to the right of the quotes and click the ampersand button.
13 .Double-click Trim in the function list, which appears in the formula box with "text" highlighted, then double-click the Last Name field in the field list (Figure 4.34).
14 .In the formula box, highlight "resultTwo" and double-click the Trim function. With "text" highlighted in the formula box, double-click Greeting Name in thefield list (Figure 4.35). Click to the end of the line.
15 .In the Operators keypad, click the ampersand button, then click the quotes button and type a colon between the quotes.
16 .Make sure your calculation is set to Text, then click OK twice to finish.