Multiple if Statements

A

Alex

Hi I am trying to create a multiple if statement and am getting really weird
results.

Top test, I am using a nw blank document.
i have attached the datasourse which is a n MS Access query (multiple
tables). i have looked at the datasouce in Word and it is correct. I have
then selected Insert Word Field, and selected If..Then..Else.

The dialog box that appears I select the field which is the field SOURCE.
I have then selected the Comparison which is EQUAL and entered the
comparison text which in the first case is TM- Dennis Glynn".

In the show this text box i have entered "Dennis" ( no quotes) and in the
Otherewise show box I have entered "Not dennis" (again no quotes)

This actually works because the first record is true. However if I right
click and toggle Field Codes, I see the following:

{IF TM-Dennis Glynn = "TM -Dennis Glynn" "Dennis" "Not Dennis"} The start
and end bracket are in bold.

My questions are:
why am i not seeing the fieldname, and
how do I then enter the second If statement.

I have tried putting a new if statement where "Not Dennis" is above but that
doesn't work - all I see if the Otherwise show text option for second If
statement.

Thanks

Alex
 
G

Graham Mayor

Your syntax is wrong. What you should have is
{IF {Mergefield Fieldname} = "TM -Dennis Glynn" "Dennis" "Not Dennis"}
both pairs of {} are set with CTRL+F9.
Where the content of fieldname = TM -Dennis Glynn the result will be Dennis
otherwise it will be Not Dennis

Note that the spelling must be identical to the content. You had an extra
space in the test.
{IF TM-Dennis Glynn = "TM[unwanted space here!]-Dennis Glynn" "Dennis" "Not
Dennis"}


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


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

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