View Single Post
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Rothrock Rothrock is offline
external usenet poster
 
Posts: 2
Default Merge multiple records into one

I'm trying to merge an old multiple choice and true false test from some XML
to Word. I've opened the XML in Excel to get rid of a bunch of tags and
attributes that I don't need.

The problem is that each question has a record for each answer so the
multiple choice questions will look like this:

ID1 questiontext answer 1
ID1 questiontext answer 2
ID1 questiontext answer 3 true
ID1 questiontext answer 4

And the true false will look like:

ID2 questiontext true
ID2 questiontext false true

All parts of a given question have the same ID number.

I want to merge then into a word document so that I have each question only
appear once, and then have the answers appear below. Then have the next
question and so on.

I tried using SET to set a currentID variable and then NEXT to see if the
next record had the same ID, but since that cannot be used inside
conditionals I am getting nowhere.

Basically what I want to do is say, if this record has a different ID than
the one before, merge this, this and this, if it has the same ID as the one
before then only merge this and this.

Is there a way to do this?