title: How to mail merge multiple records to one document
body: <p>I need to mail merge Access data from multiple records into 1 document.  The document has standard text (form letter in the code below) at the top, followed by fields common to all the records (vendor), followed by multiple rows unique to each record (BC, Account, subaccount, amount), finally followed by more common data (payee) and text (more stuff).</p>
  
  <p>Instead of putting all the record specific data together in the middle of the document, I get the first block of common data, then data from 1 record, the the rest of the common data, then the data from the 2nd record.</p>
  
  <p>My setup in Word is</p>
  
  <pre><code>{ if{ mergeseq } ="1" { set var1 "" } { set var1{ mergefield key } }}
  { if { var1 } &lt;&gt;{ var2 } "{ if { mergeseq } &lt;&gt;"1" "}
  Form letter
  { MERGEFIELD "Vendor_" }
  " ""}
  { MERGEFIELD "BC" } { MERGEFIELD "Account" } { MERGEFIELD "SubAccount" }
  { MERGEFIELD "Amount" }
  { if { var1 } &lt;&gt;{ var2 } "{ if { mergeseq } &lt;&gt;"1" "}
  more stuff
  { MERGEFIELD payee}
  " ""}
  { set var2 { mergefield key }}
  </code></pre>
  
  <p>I'm using Office 2010.</p>