Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 07-06-2021, 08:45 AM
Voljen Voljen is offline Again Mail Merge from multiple sheet (MAC) Mac OS X Again Mail Merge from multiple sheet (MAC) Office 2016 for Mac
Novice
Again Mail Merge from multiple sheet (MAC)
 
Join Date: Jul 2021
Posts: 2
Voljen is on a distinguished road
Default Again Mail Merge from multiple sheet (MAC)


Hello, everyone. I have tried to follow the various tips in the forum, but I cannot solve my problem.
I have an excel file containing multiple sheets. In the same directory I have a word file which I use to generate the final documents.
In the excel file the sheets are called "Sheet1" and "Sheet2".
In the word file the template completes correctly with the data it extracts from Sheet1. Now I would like to insert the data from Sheet2, but I keep having problems.
I'm on Mac, in case this might have some impact on the query to be generated.

I have tried making the following query:
{ DATABASE \d"{FILENAME \p}/../filename" \s " SELECT * FROM [Sheet2$] WHERE [ID Name] = { MERGEFIELD ID_Name } " \l "15" \b "49" \h }
Basically, I wanted the query to go back to the path of the excel file from the path of the word file, select all the fields in Sheet2 where the column with the "ID Name" header was equal to the analysed "ID_Name" value used in word.

1) Unfortunately, the relative link doesn't seem to work, so I modified the path by putting the absolute address, and so I can start to do some tests... Even if I don't understand how to solve this first problem!

2) It doesn't select Sheet2, but automatically takes Sheet1... Here too I don't understand why.

3) The query returns an error, unless I delete "WHERE [ID Name] = { MERGEFIELD ID_Name }". So at least it returns results, but not filtered (and especially from Sheet1, as mentioned above

Does anyone have any ideas on how I could fix this?

Thanks
Reply With Quote
  #2  
Old 07-07-2021, 12:21 AM
nandana@cbsl.lk nandana@cbsl.lk is offline Again Mail Merge from multiple sheet (MAC) Windows 10 Again Mail Merge from multiple sheet (MAC) Office 2019
Novice
 
Join Date: Jul 2021
Posts: 1
nandana@cbsl.lk is on a distinguished road
Default Text filtering in query string of database fields

If ID_Name is text, format your query string as follows;

WHERE [ID Name] = /"{ MERGEFIELD ID_Name }/"
Reply With Quote
  #3  
Old 07-07-2021, 01:40 AM
Voljen Voljen is offline Again Mail Merge from multiple sheet (MAC) Mac OS X Again Mail Merge from multiple sheet (MAC) Office 2016 for Mac
Novice
Again Mail Merge from multiple sheet (MAC)
 
Join Date: Jul 2021
Posts: 2
Voljen is on a distinguished road
Default

Thanks, but it still doesn't work.

I'm afraid there is some problem with office on Mac. I downloaded the example available here: https://www.msofficeforums.com/mail-...html#post67097

I then tried to update the field but it says "Error. The data source cannot be opened", even though I haven't changed anything... Any ideas?
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Again Mail Merge from multiple sheet (MAC) Mail Merge Student Transcript - Multiple Years from multiple sheets aizah2018 Mail Merge 1 11-11-2018 01:27 AM
Mail Merge to multiple employees in multiple locations as PDF by location GFiz Mail Merge 1 05-13-2017 08:01 PM
Again Mail Merge from multiple sheet (MAC) mail merge from excel sheet mahesh kumar gupta Mail Merge 2 08-09-2015 03:10 AM
Mail merge, text boxes, and two documents per sheet! MelissaAnnie Mail Merge 2 09-24-2014 03:46 PM
Again Mail Merge from multiple sheet (MAC) How do I merge data from one sheet in a workbook out into multiple sheets nolesca Excel 4 06-07-2010 08:13 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 08:11 PM.


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