WD: Can't Use Result of Form Field in Conditional StatementLast reviewed: February 2, 1998Article ID: Q105890 |
The information in this article applies to:
SYMPTOMSIn Word, the results of form fields can be referenced elsewhere in the document, but they cannot be used in conditional statements. For example, if you have a drop-down box whose bookmark name is dropdown1, and you use the following field to evaluate the result of dropdown1
{if { REF dropdown1 } = "female" "Dear Ms." "Dear Mr."}the result of this field will always be "Dear Mr.," regardless of what option was selected in the drop-down box.
CAUSEIn Word versions 6.x and 7.x, form fields are considered display fields, which means their results are pictures, not text strings that can be evaluated.
WORKAROUNDTo work around this problem, use the REF field to reproduce the results of a form field. Syntax of this field is
{REF bookmarkname}where "bookmarkname" can be the default name given to the bookmark or a custom name. To find the bookmark name, click Form Field on the Insert menu, and then click Options.
Word 97 for Windows or Word 98 Macintosh EditionIn Word 97 or Word 98, you can use the result of a form field in a conditional statement using the REF field as in the following example:
{if { REF Dropdown1 } = "female" "Dear Ms." "Dear Mr."}In addition, in these versions of Word you can turn on the Calculate on Exit form field option to cause the conditional field to be updated automatically. To turn on Calculate On Exit, follow these steps:
|
Additional query words: checkbox results field codes
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |