Microsoft KB Archive/105890: Difference between revisions
(importing KB archive) |
m (Text replacement - """ to """) |
||
Line 29: | Line 29: | ||
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 | 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 | ||
<pre> {if { REF dropdown1 } = | <pre> {if { REF dropdown1 } = "female" "Dear Ms." "Dear Mr."} | ||
</pre> | </pre> | ||
the result of this field will always be | the result of this field will always be "Dear Mr.," regardless of what option was selected in the drop-down box. | ||
== CAUSE == | == CAUSE == | ||
Line 44: | Line 44: | ||
<pre> {REF bookmarkname} | <pre> {REF bookmarkname} | ||
</pre> | </pre> | ||
where | 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 Edition === | === Word 97 for Windows or Word 98 Macintosh Edition === | ||
In 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: | In 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: | ||
<pre> {if { REF Dropdown1 } = | <pre> {if { REF Dropdown1 } = "female" "Dear Ms." "Dear Mr."} | ||
</pre> | </pre> | ||
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: | 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: | ||
Line 70: | Line 70: | ||
</span><br /> | </span><br /> | ||
<br /> | <br /> | ||
THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED | 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.</blockquote> | ||
|} | |} | ||
Last reviewed: February 2, 1998<br /> | Last reviewed: February 2, 1998<br /> | ||
© 1998 Microsoft Corporation. All rights reserved. [[../cpyright|Terms of Use.]]<br /> | © 1998 Microsoft Corporation. All rights reserved. [[../cpyright|Terms of Use.]]<br /> |
Latest revision as of 09:12, 20 July 2020
WD: Can't Use Result of Form Field in Conditional StatementLast reviewed: February 2, 1998 |
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 |
Last reviewed: February 2, 1998
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.