|
|
|
Creating a Relational Customer and Customer Orders System Using LogiBridge and MS Access
|
|
Page
4 of 8
|
|
|
|
Next were going to add 3 calculation fields to the form. We'll add subTotal,shippingTotal and a OrderTotal field to the form. Calculation fields
allow you to add conditional statements and calculate totals and subtotals based on selections on your form. For detailed information about how
to write calculations, see this tech note.
Adding the SubTotal Calculation Field:
- Click the EDIT button next to the shipping field and select Insert Form Element > Insert After.
- Select Special Fields from the field type drop down menu and then select Calculation Field and press Continue.
- The Field Settings Window should now be loaded.
- Name the field SubTotal by entering it in the field name input
- Next, enter Sub Total in the caption input
- Click the Calculations Tab to advance.
- Cut and Paste the following into the calculation textarea
IF [PRODUCT] = 'Red Hat $12.95' THEN
[SUBTOTAL] = 12.95
ELSEIF [PRODUCT] = 'Purple Shirt $34.95' THEN
[SUBTOTAL] = 34.95
ELSEIF [PRODUCT] = 'Designed HandBag $165.95' THEN
[SUBTOTAL] = 165.95
ENDIF
|
- Click the Save & Close tab to save the new field and return to the form
Adding the Shipping Total Calculation Field:
- Click the EDIT button next to the subTotal field and select Insert Form Element > Insert After.
- Select Special Fields from the field type drop down menu and then select Calculation Field and press Continue.
- The Field Settings Window should now be loaded.
- Name the field shippingTotal by entering it in the field name input
- Next, enter Shipping Total in the caption input
- Click the Calculations Tab to advance.
- Cut and Paste the following into the calculation textarea
IF [SHIPPING] = 'Priority Courier $15.00' THEN
[SHIPPINGTOTAL] = 15.00
ELSEIF [SHIPPING] = 'Regular $0.00' THEN
[SHIPPINGTOTAL] = 0.00
ELSEIF [SHIPPING] = 'Overnight $25.00' THEN
[SHIPPINGTOTAL] = 25.00
ENDIF
|
- Click the Save & Close tab to save the new field and return to the form
Adding the Order Total Calculation Field:
- Click the EDIT button next to the shippingTotal field and select Insert Form Element > Insert After.
- Select Special Fields from the field type drop down menu and then select Calculation Field and press Continue.
- The Field Settings Window should now be loaded.
- Name the field orderTotal by entering it in the field name input
- Next, enter Total in the caption input
- Click the Calculations Tab to advance.
- Cut and Paste the following into the calculation textarea
[ORDERTOTAL] = [SUBTOTAL] + [SHIPPINGTOTAL]
|
- Click the Save & Close tab to save the new field and return to the form
Now, when you change the shipping or the selected product, the subTotal, shippingTotal and the orderTotal are updated
to reflect the selection.

Figure 5: Your Form should now closely resemble the example shown here
|
Page
4 of 8
|
|
|
|
|