Thread: Next If
View Single Post
  #9   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Andrew Bosanquet Andrew Bosanquet is offline
external usenet poster
 
Posts: 1
Default Next NEXTIF question

I am probably trying to mimic the NEXTWHILE (that does not exist).

I want to include data from the next record(s) while one field stays the same. For instance, I want three documents from the following data:

Field1 / Field2 / Field3
1 / A / a
1 / B / b
3 / C / c
7 / D / d
7 / E / e
7 / F / f
7 / G / g

Documents to be headed 1, 3, and 7.
Document1 to have a table of A/a, B/b.
Document3 to have a table of C/c.
Document7 to have a table of D/d, E/e, F/f, G/g.

Documents and tables are all sorted – I just cannot get the logic right.

Can I COMPARE { MERGEFIELD FIELD1 } with FIELD1 in the *next* record?

Many thanks

Andrew


EggHeadCafe.com - .NET Developer Portal of Choice
http://www.eggheadcafe.com