View Single Post
  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
Default Next Record If - MS Word mail merge

What you are trying to do is a "multiple items per condition (=key field)"
mailmerge which Word does not really have the ability to do out-of-the box.

You can however do it by following the method on the following website:

http://cornell.veplan.net/article.aspx?&a=3815


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

"Marc Hendrickx" wrote in message
...
I've used "Next Record If" years ago without any problems yet now I can't
make it work.. Can someone help?

This is a simplified version: I want to use mail merge let parents know what
prizes their children have won.

Main document:

----------------------------------------------------------------------------
Dear { MERGEFIELD Parents },

Congrats!


Here are the prizes:
{ MERGEFIELD Child } { MERGEFIELD Prize }
{ NEXTIF { MERGEFIELD Last } = "" } { MERGEFIELD Child }
{ MERGEFIELD Prize }
{ NEXTIF { MERGEFIELD Last } = "" } { MERGEFIELD Child }
{ MERGEFIELD Prize }
{ NEXTIF { MERGEFIELD Last } = "" } { MERGEFIELD Child }
{ MERGEFIELD Prize }
{ NEXTIF { MERGEFIELD Last } = "" } { MERGEFIELD Child }
{ MERGEFIELD Prize }
{ NEXTIF { MERGEFIELD Last } = "" } { MERGEFIELD Child }
{ MERGEFIELD Prize }

---------------------------

Data source:

-------------------
ParentsChildPrizeLast
John and MaryPetertrain set
John and MaryLisadoll
John and MaryMarccomputery
Mike & AnnTombooky
LisaFridamobile phone
LisaAnnadressy
Matt & SarahLukelaptopy
Frank & RosieJohnmonopoly
Frank & RosiePatDisney trip
Frank & RosieClaireDVD
Frank & RosieThierrywallety
CindyOliverbooky


-------------------

So the rule would be that as long as Last is empty the data (Child and
Prize) of next record have to be merged in the existing document. If it's
false then a new merge document willl be created for the data of the next
record.

In the example the comparison { MERGEFIELD Last } = "" } is true up to John
and Mary / Marc.For John and Mary / Marc the comparison is false so this
should trigger Word to create an new merge document for Mike and Ann. It is
then for Mike and Ann false again so again an new merge document.. Then it's
true for Lisa / Frida so Anna will come on the same page but Matt and Sarah
start at a bew document etc..

Doesn't work.. The row with "y" is repeated to make six lines:

Peter train set
Lisa doll
Marc computer
Marc computer
Marc computer
Marc computer

(next page)

Tom book
Tom book
Tom book
Tom book
Tom book
Tom book

(next page)

Frida mobile phone
Anna dress
Anna dress
Anna dress
Anna dress
Anna dress