Show/Hide Toolbars

PerfectForms™ Help Guide

Navigation: PerfectForms™ Help Guide > Designing a Form > Adding Behaviors

Calculations and Setting Field Values

Scroll Prev Top Next More

Use the Set Field command to add the values of numeric fields together and then populate a form field with the calculated value.


Interactive Example IconInteractive Example  

To see a demonstration of formulas and calculations, see the Date and Time Calculations Example topic (available only in the online version of this help guide). For a step-by-step tutorial, see the Add a Calculation to the Table topic found in the Tutorials help guide.


Document Icon

1.With a form loaded in the Form Designer in Layout view, select the field or button object

2.On the Properties bar, choose the event that should trigger the Set Field behavior to run. PerfectForms™ switches to the Behavior view.

Example: When a user clicks the Next button, the Set Field behavior should run in order to populate a Subtotal field on the form. So, the form object that will trigger the behavior event is the Next button and the event is Button Is Pressed.

3.From the Objects Commands section of the Toolbox, drag and drop the Set Field command onto the behavior canvas.

4.On the Properties bar under the Field section, click Select. Choose the field where the result of the calculation should be written.

5.In the Value section of the Properties bar, select the data that should populate the field.

Note: Other options allow you to populate the field with text or the contents of another field or other data that is not the result of a calculation. See the Set Field Properties reference for a full description of the Value properties.

6.To populate the field with a calculated value, choose Formula and click Compose. PerfectForms™ displays the Formula Editor.

Note: See the Formula and Condition Editor topics for more information.

7.Select the <empty> line and then select Value of a Field on the right.

8.Click Select and locate the first field to act as part of the calculation.

9.Click Add Line.

10. Click on the added <empty> line and then select Value of a Field on the right.

11. To change the operator from the default plus (+) sign, click the + and choose a different operator from the list.

12. Click OK. You have now built a formula that evaluates the values of two fields and places the resulting calculation in a form field.