Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Mailmerge and Fax / September 2004

Tip: Looking for answers? Try searching our database.

Multiple if Statements

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Alex - 20 Sep 2004 12:04 GMT
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
Graham Mayor - 20 Sep 2004 12:48 GMT
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"}

Signature

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

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

> Hi I am trying to create a multiple if statement and am getting
> really weird results.
[quoted text clipped - 29 lines]
>
> Alex

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.