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 / June 2007

Tip: Looking for answers? Try searching our database.

Show two fields from next record conditional upon one original fie

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Russell Pascoe - 15 Jun 2007 12:38 GMT
Thanks for looking at this, it's got me foxed, I feel I'm on the cusp of
working it out, but not quite!

I want to print a document using  a database that sometimes interlinks with
the next record. I run a small property business and would like to automate
the contract process. I fill in the database with all details and then go to
print the contract interrogating the database. Sometimes there is one tenant,
sometimes two. So sometimes I want to put two names on the contract - surely
a simple "IF THEN" statement? i.e.:

First Name  ¦  Last Name  ¦ Property  ¦ Sharing  ¦  Rent
John              Brown           3234         Yes           250
Jane              Brown           3234         Yes           250
Fred              Smith            3235         No            230

So what I want is to go to the first record, get John Brown's name, which is
easy, but then do IF THEN ELSE, IF Sharing = "Yes" "Next Record First_Name
Last_Name" "." But I can't seem to get the syntax right and am producing
nonsense all over the place.

If you know how to help me, I would be very grateful!

Thank you!
Russell.
Peter Jamieson - 15 Jun 2007 12:58 GMT
Off the top of my head, try

{ NEXTIF "{ MERGEFIELD Sharing }" = "Yes" }
}{ IF "{ MERGEFIELD Sharing }" = "Yes|"
"{ MERGEFIELD First_Name } { MERGEFIELD Last_Name }" ""
} whatever text you want regardless of whether there are one or two.

However, it will only work properly if the "Sharing" properties always come
in pairs (not in 1s, 3s etc.)

All the {} need to be the special field braces that you can insert using
ctrl-F9, as usual.

Peter Jamieson
> Thanks for looking at this, it's got me foxed, I feel I'm on the cusp of
> working it out, but not quite!
[quoted text clipped - 26 lines]
> Thank you!
> Russell.
Graham Mayor - 15 Jun 2007 13:03 GMT
You cannot nest NEXT fields nor can you look backwards through the record
set.
See How to use mail merge to create a list sorted by category in Word 2002 -
http://support.microsoft.com/?kbid=294686

Signature

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

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

> Thanks for looking at this, it's got me foxed, I feel I'm on the cusp
> of working it out, but not quite!
[quoted text clipped - 21 lines]
> Thank you!
> Russell.
 
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.