Microsoft KB Archive/66974

= WD97: Using the ASK Field with the IF Field in Word =

Article ID: 66974

Article Last Modified on 11/16/2006

-

APPLIES TO


 * Microsoft Word 97 Standard Edition

-



This article was previously published under Q66974



SUMMARY
To use the ASK field conditioned upon the value of another field, include the IF statement inside the ASK field instead of including the ASK statement in the IF field.



Example 1: Entry of &quot;None&quot; for No Spouse
The following example asks if you are married. If you respond with &quot;Yes,&quot; it then asks for your spouse's name. If you respond with &quot;No&quot;, it will then ask you to type &quot;none.&quot; (The \*Firstcap switch is included so the response can be &quot;yes&quot; or &quot;Yes&quot;.)

{ASK Married &quot;Are you married?&quot; \*Firstcap}

{ASK SpouseName {IF Married = &quot;Yes&quot; &quot;What is your Spouse's Name?&quot;

&quot;Type 'none'&quot;}}

{REF Married}

{REF SpouseName}

In this example, the second ASK field has an IF statement that determines if the bookmark &quot;Married&quot; is equal to &quot;Yes.&quot; If it is, the IF field has the value &quot;SpouseName.&quot; If not, the field has no value. The ASK field is not updated if it does not have a valid bookmark name as the first element; therefore, it does not ask the question.

Example 2: No entry for No Spouse
The following example asks if you are married. If you respond with &quot;Yes,&quot; it then asks for your spouse's name. If you respond with &quot;No,&quot; it will enter No for the reference to the bookmark of &quot;Married&quot; and no question will be asked about the spouse. No entry will be made to the bookmark called &quot;SpouseName.&quot;

{set SpouseName &quot;&quot;}

{ask Married &quot;Are you married?&quot; \* firstcap}

{ask{if{Married}=&quot;Yes&quot; &quot;SpouseName&quot;}&quot;What is your Spouses's name?&quot;}

Additional query words: fill in conditional fillin

Keywords: kbfield kbinfo KB66974

-

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

© Microsoft Corporation. All rights reserved.