Results 1 to 5 of 5
  1. #1
    4 Star Lounger
    Join Date
    Aug 2001
    Location
    Anaheim, California, USA
    Posts
    560
    Thanks
    17
    Thanked 2 Times in 2 Posts

    Mail Merge to Word (2002/SR2)

    I have a registration database for our summer program. I have a table for each family and then a table for each child, that is tied to the family table with a family #. The input is done on a form with a subform for each child. Some families have 1 child, some have up to 3.

    What I want to do is send them a confirmation letter, in Word, but I would like to include all the information for each child, on one letter. In other words, I want to send a letter to the Jones family, confirming Dot and Jim and maybe one to the Smith family, confirming Sally.

    How do I create the query that will supply the information this way to Word? I'm sure that there is a way, I'm just stumped on how to do it. Thanks for any help.

  2. #2
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,623
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: Mail Merge to Word (2002/SR2)

    This get fairly tricky to do strictly in Word, though I suspect you could tackle it with {Next} fields in an IF statement field. Doing it in the Access query isn't exactly trivial either. A reasonably simple way to do it is to make a temporary table that contains the names of the children for a family in consecutive fields in the table, or concatenates all the the children's names into a text string. However the simplest was to do that is to write some VBA code that steps through the set of child records and puts them into the table, so if you aren't comfortable with DAO or ADO that might pose a challenge. Another alternative is to use Word with OLE Automation to build the document on the fly rather than doing a merge, but that involves lots more code and a good understanding of the Word object model. It's possible you could do a count of the number of children in each family and then use that in conjunction with the Word {Next} field. Hope this gives you some ideas.
    Wendell

  3. #3
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: Mail Merge to Word (2002/SR2)

    A much easier solution is to forget about Word and create the letter as an Access report. You can use grouping to include the family and children info in the one "letter".

    Letters written as Access reports are harder to edit later, don't give you as many formatting options, and make it a bit more difficult to merge info into the middle of a sentence.

    Create a query with both family and children info, then in the report group by family.
    Regards
    John



  4. #4
    4 Star Lounger
    Join Date
    Aug 2001
    Location
    Anaheim, California, USA
    Posts
    560
    Thanks
    17
    Thanked 2 Times in 2 Posts

    Re: Mail Merge to Word (2002/SR2)

    I thought about doing the letter in Access but then figured, naahhh! there has to be an easy way to do it and I'm just missing it. Oh, well.

    I already have the query and have created a report that shows what I want, I think I can just change the report to a letter and have it go to a new page everytime the family # changes. Thanks for the suggestions.

  5. #5
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,623
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: Mail Merge to Word (2002/SR2)

    One other strategy you might try. You can export your Access report to Word by using an export to RTF format if the report is pretty simple. Then you can do last minute cleanups in Word, and do any fancy formatting you want there. Just another way to skin the <img src=/S/catty.gif border=0 alt=catty width=19 height=18>, so to speak
    Wendell

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •