IF Field expression not working

H

Hans

I'm trying to use an IF statement to add text to a 2003 Word doc based on the
numerical value of a form field (whose bookmark name is TimeAndExpense). It's
not working.

Here's the field code:

{ IF { FORMTEXT TimeAndExpense } >0 "Display This Text" " " }

Am I trying something that's not possible? If the form field with bookmark
name TimeAndExpense is blank, the text string is nonetheless displayed.

Thanks...
 
S

Suzanne S. Barnhill

IF fields in forms require REF fields to reference form field bookmarks. So
you need this:

{ IF { REF TimeAndExpense } > 0 "Display This Text" }

You don't need the FalseText if it's just blank.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
http://word.mvps.org
 
G

Graham Mayor

Note the field will not work without macro assistance if placed in the
header/footer; and if in the body of the text, you will need to set the
calculate on exit property of the TimeandExpense form field in order to
force the calculation.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top