WD: A Field Calculation Error Occurred in Record . . .

Last reviewed: February 5, 1998
Article ID: Q120278
The information in this article applies to:
  • Microsoft Word for Windows, versions 6.0, 6.0a, 6.0c
  • Microsoft Word for Windows 95, versions 7.0, 7.0a
  • Microsoft Word for the Macintosh, versions 6.0, 6.0.1, 6.0.1a

SYMPTOMS

Word for Windows

The error message "A field calculation error occurred in record #" (where # is every record number) may appear when you use an IF field to include files whose names are specified in other merge fields, and any of the merge fields specified is blank.

The following is a sample statement that will exhibit this problem

   {IF {MERGEFIELD contribution} > 1000 {INCLUDETEXT {MERGEFIELD thanks}}
   {INCLUDETEXT {MERGEFIELD give_more}} }

where "thanks" and "give_more" are fields in the data document that contain names of files to be included, and either of the fields is blank.

Word for the Macintosh

In Word 6.0 for the Macintosh, when using an INCLUDETEXT field to include a document, if the path is not enclosed by quotation marks, the error message "A field calculation error occurred in record #" will appear. The following is an example that will give the error:

   {IF {MERGEFIELD No} > 1 "{INCLUDETEXT Mac HD:Desktop Folder:Doc 1}
   "{INCLUDETEXT Mac HD:Desktop Folder:Doc 2}" }

Also, if there are any extra spaces in the path statement, the same error will appear. In the example above, if there is a space inserted after either ":" (colon), the error will appear, regardless of whether the quotation marks are used.

CAUSE

This happens because of the order in which fields are updated. Innermost fields are updated first, and they are updated from left to right. Thus, {MERGEFIELD thanks} is the first field evaluated. If it is blank, Word cannot finish evaluating the field. If it contains text but {MERGEFIELD give_more} does not, the IF field still cannot be evaluated.

WORKAROUND

Change the data document to always refer to two files. Create a file with just one character in it, and refer to this field in the previously blank field of the data document.

For example, create a new file and type one character in it. Save the file as Blank.doc. In those records that don't contain any typing in the Thanks field, type Blank.doc. In those records that don't contain typing in the give_more field, type Blank.doc. Word can update both merge fields and will include the correct file.


Additional query words: 8.0 8.00
Keywords : kbfield kbmerge macword winword word6 word7 word95 word97 kberrmsg
Version : WINDOWS:6.0,6.0a,6.0c,7.0,7.0a,97; MACINTOSH:6.0,6.0.1,6.0.1a
Platform : MACINTOSH WINDOWS
Issue type : kbprb
Solution Type : kbworkaround


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: February 5, 1998
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.