View Single Post
  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Cindy M -WordMVP-
 
Posts: n/a
Default IF statements not working

Hi ?B?amVybXNhbGVybXM3OQ==?=,

I am trying to use a mail merge with the following if then statement and it
is returning the false response on everything even if the result is true. Am
I writing the formula wrong. I am using ctrl - F9 to insert { }.

Here is the formula:

{ IF{ MERGEFIELD Purpose_LOANPURPOSE } = "Purchase" "Purchase" "Refi"}

so if the field is purchase the result should be purchase and if it is not
then the result is refi.

Well, you do need a space between IF and the start of the mergefield brackets.

You might also try placing the Mergefield in "quotes".

The only other thing I can suggest would be to insert the mergefield outside
the IF so that you can see if the values you expect are truly coming through.
You could get unexpected result if, for example, you think you've got a text
field (because that's what you see in your database form), and in reality the
field is passing a number. I could imagine, in this case, that in the database
a lookup table has been defined for these values, and that in reality, an ID
number is being stored in this field, rather than the related text.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :-)