Microsoft KB Archive/822024

= BUG: Expression box gives incorrect results for mathematical expressions in InfoPath 2003 or in InfoPath 2007 =

Article ID: 822024

Article Last Modified on 4/10/2007

-

APPLIES TO


 * Microsoft Office InfoPath 2007
 * Microsoft Office InfoPath 2003
 * Microsoft XML Core Services 4.0

-



SYMPTOMS
With a Microsoft Office InfoPath form template, if you add an expression box that evaluates a mathematical expression that involves decimal numbers, you may receive incorrect results.



STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.



Steps to Reproduce the Problem
 In InfoPath, design a new, blank form. In the Design Tasks pane, click Layout to open the Layout task pane. In the Layout task pane, click Table with Title. In the table, click the text Click to add a title, and then type Accounting Example . Right-click the text Click to add form content, and then click Split Cells. In the Split Cells dialog box, set Number of columns to 3, set Number of rows to 3 , and then click OK. Add data to the cells as follows: <ol style="list-style-type: lower-alpha;"> Add the following text to the table: </li> In the task pane, click Controls to open the Controls task pane.</li> Click inside the cell on the second row and the second column, and then click Text Box in the task pane to add a text box.</li> Right-click the text box, and then click Text Box Properties.</li> In the Text Box Properties dialog box, set Data type to Decimal (double), set Default value to 1.225 , and then click OK.</li> Repeat steps c through e for the cell in the second row and the third column, but set Default value to 1.225 .</li> Repeat steps c through e for the cell in the third row and the second column, but set Default value to 1.333 .</li> Repeat steps c through e for the cell in the third row and the third column, but set Default value to 1.333 .</li></ol> </li> Click outside the table, and then press the ENTER key. Type the following:

Does account reconcile?

</li> Switch to the Controls task pane, and then click Expression Box.</li> In the Insert Expression Box dialog box, set XPath to the following, and then click OK:

(my:field1)+(my:field3)-(my:field2)-(my:field4)=0

</li></ol>

Notice that the value of the expression box is set to false after you follow these steps.

Additional query words: IP2007

Keywords: kbxml kbbug KB822024

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.