View Single Post
  #5   Report Post  
Graham Mayor
 
Posts: n/a
Default

I *always* put quotes around the field results in IF constructions and
calculations - even where they are not strictly required - because it makes
the statements easier to debug.

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org




Charles Kenyon wrote:
I would use:
{ IF {MergeField "State" } = "California" {MergeField Division_No} }
I definitely like to make my MergeField and Ref field references
explicit. It makes debugging a lot easier. Remember that the braces
must be inserted by Word, not just typed. I sometimes put quotation
marks around my mergefields in IF fields and calculation fields. That
may just be superstitious behavior on my part, though.

"theryno" wrote in message
...
I guess I should not have used State Abbrev as an example.

If the state is California, I would want to show the division number,
otherwise show nothing. Would I then use:
{ IF {MergeField "State" } = "California" Division_No }?

THANK YOU!!!

"Charles Kenyon" wrote:

That is what the IF field is for.

{ IF {MergeField "State" } = "California" "CA" }

Didn't see the sense of including another mergefield if the only
state is California, if you need the mergefield, insert that
instead. --
Charles Kenyon

Word New User FAQ & Web Directory: http://addbalance.com/word

Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide

See also the MVP FAQ: http://www.mvps.org/word which is awesome!
--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.