A Microsoft Word forum. Microsoft Office Word Forum - WordBanter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Microsoft Office Word Forum - WordBanter forum » Microsoft Word Newsgroups » Mailmerge
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Next Record If - MS Word mail merge



 
 
Thread Tools Display Modes
  #1  
Old August 20th 08, 07:04 AM posted to microsoft.public.word.mailmerge.fields
Marc Hendrickx
external usenet poster
 
Posts: 1
Default Next Record If - MS Word mail merge

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:

-------------------
Parents
Child
Prize
Last

John and Mary
Peter
train set


John and Mary
Lisa
doll


John and Mary
Marc
computer
y

Mike & Ann
Tom
book
y

Lisa
Frida
mobile phone


Lisa
Anna
dress
y

Matt & Sarah
Luke
laptop
y

Frank & Rosie
John
monopoly


Frank & Rosie
Pat
Disney trip


Frank & Rosie
Claire
DVD


Frank & Rosie
Thierry
wallet
y

Cindy
Oliver
book
y




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



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





Ads
  #2  
Old August 20th 08, 10:49 AM posted to microsoft.public.word.mailmerge.fields
Doug Robbins - Word MVP
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




 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
WORD 2007 mail merge - only one record shank Mailmerge 1 July 28th 08 04:41 AM
Word Mail Merge - Go back to first record Snow White Microsoft Word Help 6 May 12th 08 01:00 AM
word 2003 mail merge toolbar display record number Joel Tables 1 January 10th 08 05:00 PM
word+excel mail merge omits 1st numeric record JDavidson Mailmerge 5 January 12th 06 11:15 AM
sort mail merge by merge record number nathan Mailmerge 1 August 10th 05 07:09 AM


All times are GMT +1. The time now is 04:48 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Copyright 2004-2014 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.