Data for Mailomerge

Posted on 2012-09-08
Last Modified: 2012-09-09
Hi All,

We are an academy and I want to create a mail merge in Word and then send this via Outlook. However, I first need to format my data into a meaningful way. I am connecting to a remote SQL server databse.

 This is where I have my problem.

I want to send a message to all my parents asking them to confirm the information I have on them.

The first bit is easy, I connect to’ tbl_Parents’ where I have their <<Name>>, <<Address>>, <<Email>> etc. If this was all I would simply loop through these and that would be it. However, I also now need to list their children and their date of birth etc. That means for each parental account I need to open ‘tbl_Students’ and collect an array of all the students which match the parental account unique ID.

The last bit I do not seem to be able to do in Word. Is this possible.
Question by:Abiel de Groot
    1 Comment
    LVL 76

    Accepted Solution

    Your data is in a one-to-many relationship and this is a frequently-asked-question.

    The general approaches are:

    1. Create a flat record set by adding extra columns according to the maximum number of related items in the 'many' set.

    2. To use Word field logic to detect a change of item in the 'one' part of the data and only then to include that text.

    3. To use VBA

    There are some more details in my answer to this question:

    Feel free to ask for clarification on any of the points.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Get an idea of what you should include in an email disclaimer with these Top 5 email disclaimer tips.
    Use email signature images to promote corporate certifications and industry awards.
    The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
    This Micro Tutorial well show you how to find and replace special characters in Microsoft Word. This is similar to carriage returns to convert columns of values from Microsoft Excel into comma separated lists.

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now