WD: Calculation Form Field Returns "$ 0" (126255)



The information in this article applies to:

  • Microsoft Word for Windows 6.0
  • Microsoft Word for Windows 6.0a
  • Microsoft Word for Windows 6.0c
  • Microsoft Word for Windows 95
  • Microsoft Word for Windows 95 7.0a
  • Microsoft Word 97 for Windows

This article was previously published under Q126255

SYMPTOMS

If you add a calculation form field to a form and the result is in dollars, the field will return "$ 0" (without the quotation marks) if there are no values to calculate.

CAUSE

This occurs by program design and is consistent with other numeric display functions in Word.

RESOLUTION

To force the calculation field to return nothing if no values are available to compute, two number formats must be used.

While the form is unprotected, do the following:
  1. Double-click the calculation field to be altered.
  2. In the Form Text Field Options dialog box, type a number sign ( #) in the Number Format box and choose OK.
  3. Press ALT+F9 (in page layout view) or select the field and press SHIFT+F9. This enables you to view the field code.
  4. Between the final two braces ({}), enter the number format desired.

    For example:

    {FORMTEXT { =A1 + B1} \# $#,##0.0;($#,##0.0)}

    Where "$#,##0.0;($#,##0.0)" (without the quotation marks) is the desired format when the value is not 0 (zero).
NOTE: The result of the calculation form field will be a whole number. The numbers being referenced are rounded to the nearest whole number. Any further editing of the calculation form field will cause the number formatting commands that were added to be removed from the field.

Modification Type:MinorLast Reviewed:8/16/2005
Keywords:kbfield kbualink97 KB126255