IF MERGEFIELD is not working...

B

Bart Paden

I am trying to use an if statement to put "and" between two fields as long
as the 2nd field is NOT BLANK. The first field is called firstname and the
second field is called secondname. Word recommends I use the following
code:

{ IF { MERGEFIELD secondname } <> "" "and" "" }

After manipulating it about 100 different ways and having it still not work
I'm completely frustrated. If there is anyone out there that has an idea of
what I am doing wrong I would really appreciate the assistance.

Thanks
B
 
G

Graham Mayor

Field boundaries {} are inserted with CTRL+F9. The construction you want is

{Mergefield firstname} {IF {Mergefield Secondname} <> "" "and {Mergefield
Secondname}"}

What you posted should also have worked if you inserted the fields
correctly.

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


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
B

Bart Paden

Graham

Thanks for the help. With a couple tweaks your suggestion worked
brilliantly!

Bart
 

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