Insert a formula

Formulas are stored in fields (field: An element or attribute in the data source that can contain data. If the field is an element, it can contain attribute fields. Fields store the data that is entered into controls.) and are displayed in the controls that are bound (bind: To connect a control to a field or group in the data source so that data entered into the control is saved. When a control is unbound, it is not connected to a field or group, and so data entered into the control will not be saved.) to those fields. When designing a form, you can create formulas in text boxes, rich text boxes, date pickers, and expression boxes.

 Note   You should use an expression box only if you do not want to use the result of the formula in another formula or save it as part of a form, because expression boxes only display data and do not store it.

  1. In design mode, double-click the control where you want to create the formula.
  2. On the Data tab in the Control Properties dialog box, click Insert Formula Button image.

 Note   To create the formula by using the field's properties, right-click the field in the Data Source task pane, and then click Properties.

  1. In the Insert Formula dialog box, do one or more of the following:
Operation Symbol
Add +
Subtract -
Multiply *
Divide /


Mathematical formulas usually depend on integer or decimal values as arguments. To avoid blank values, select the Treat blank values as zero check box on the General tab in the Form Options dialog box.

 Note   The information in this topic may not apply if you are working with a form designed using Microsoft Office InfoPath 2003 without the service pack installed.

Applies to:
InfoPath 2003