[Last Call] Learn how to a build a cloud-first strategyRegister Now


Data for Mailomerge

Posted on 2012-09-08
Medium Priority
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

GrahamSkan earned 2000 total points
ID: 38379082
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.

Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Take a look at these 6 Outlook Email management tools which can augment the working and performance of Microsoft Outlook to give you a more rewarding emailing experience.
In a use case, a user needs to close an opened report by simply pressing the Escape (Esc) key. This can be done by adding macro code in Report_KeyPress or Report_KeyDown event.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

825 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