Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 01-22-2014, 04:02 AM
macropod's Avatar
macropod macropod is offline Combining Records of two sheets with Loop till Unique ID Windows 7 32bit Combining Records of two sheets with Loop till Unique ID Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,369
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
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Combining Records of two sheets with Loop till Unique ID Combining 2 workbooks into 1 workbook with TWO sheets dguenther Excel 1 10-06-2011 03:25 AM
Linking sheets to fetch transactions from sheets to another waqer Excel 4 09-01-2011 12:35 PM
Combining Records of two sheets with Loop till Unique ID Deleted mail from archive till show in search Davoud Teimouri Outlook 1 09-01-2011 09:46 AM
If two geographical data match in two sheets, copy unique id/code found in one sheet alliage Excel 1 09-01-2011 05:23 AM
From a particular cell till the end of the same column tinfanide Excel 3 08-10-2011 05:09 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 08:21 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft