Share this Page URL

Using Form Fields > Using Form Fields - Pg. 375

Figure 15-13. Selecting an item from a drop-down form field After creating the drop-down field, I'm going to copy it to all of the other cells in the Item column. That way, I don't have to reconstruct the list for each field. After copying them, I'll go back and change the bookmark name and any options I want. At this point, the form looks something like the one shown in Figure 15-13. As you can see, the first item listed in the drop-down list is always used as the default text. Selecting a drop-down field opens a menu with the other selections. The final step in this form is to add some calculations. First, I want the fields in the Total column to multiply the quantity by the price to get a total cost for each item. Figure 15-14 shows the properties of the first field in that column. I've made it a Calculation type using a number format. For the expression, I used a little trick. PRODUCT tells Word to multiply numbers. LEFT tells word to use the numbers in all of the fields to the left. Since the Item fields aren't numbers, Word ignores them and I get the result I'm after. This is much easier than referring to specific fields by row and column or even by their bookmark names. (For more information on constructing formulas, see Chapter 10.) I'll use the same properties for the other fields in the total column. Now, the form looks like Figure 15-15. I entered the quantity and price myself and Word calculated the item line totals for me. There are only three things left to do: 1. I want the Subtotal field to add up the fields in the Total column. To do this, I am going to make the field a calculation field and select the standard currency format. I'm going to use the formula =SUM(ABOVE) to add up all of the num- bers above the cell in the column. This should give me the total I want. Fields and Forms Using Forms | 375