View Single Post
 
Old 01-22-2014, 04:02 AM
macropod's Avatar
macropod macropod is offline Windows 7 32bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

You cannot do this via a Word mailmerge on its own, as a Word mailmerge can only use one data source (in this case, that's one worksheet). You could, however, combine the mailmerge of the sheet containing the parent data with a DATABASE field that extracts the corresponding Family member data from the Family members sheet. Coding such a DATABASE field would require you to have an understanding of both SQL (as you need an SQL statement to extract the data) and the field switches Word uses to tabulate the DATABASE field's output. Plus, this would only be useful if the Family member data were on separate rows for each member - not all on the same row. To give you an idea of what's involved, such a DATEBASE field's code might be:

{DATABASE \d "C:\\Users\\Some User\\Students.xlsx" \s "SELECT [LAST NAME], [FIRST NAME], FORMAT([BirthDate], \"DDD, D MMMM YYYY\") AS [Birth Date] FROM [Family Members$] WHERE [Family ID] = \"{MERGEFIELD Family_ID}\" ORDER BY [Birth Date]" \l "37" \b "51" \h}
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote