![]() |
|
|
|
#1
|
||||
|
||||
|
For an example of DATABASE field usage, see: https://www.msofficeforums.com/mail-...html#post67110 Be warned, this isn't for those who don't understand the intricacies of SQL. Besides which, you would also need to encompass the field in an IF test to ensure it only generates its output when the merge executes - not when each record is processed.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
#2
|
|||
|
|||
|
Hi several
days later .... I've made a separate mail merge for the sample sheets which I copy and paste into my main report - works a treat... I've also managed to make some code and pull the info through from the spreadsheet into the word doc tables (hurrah!) BUT... now if I make an update to the information in the excel sheet, the table wont update and I get an error message... This is the code I'm using below... Any help on what I'm dong wrong. Again sorry if this is obvious, but I've never even heard of SQL code before so am on a rather steep learning curve! Thanks {DATABASE \d "W:\\XXXXX\\XXXXX\\Trial MM data RH.xlsx" \c "Provider=Microsoft.ACE.OLEDB.12.0;User ID=Admin;Data Source=W:\\XXXX\\XXXXX\\Trial MM data RH.xlsx;Mode=Read;Extended Properties=\"HDR=YES;IMEX=1;\";Jet OLEDB:System database=\"\";Jet OLEDB:Registry Path=\"\";Jet OLEDB:Engine Type=37;Jet OLEDB atabase Locking Mode=0;Jet OLEDB:Global Partial Bulk Ops=2;Jet OLEDB:Global Bulk Transactions=1;Jet OLEDB:New Database Password=\"\";Jet OLEDB:Create System Database=False;Jet OLEDB:Encrypt Database=False;Jet OLEDB on't Copy Locale on Compact=False;Jet OLEDB:Compact Without Replica Repair=False;Jet OLEDB:SFP=False;Jet OLEDB:Support Complex Data=False;Jet OLEDB:Bypass UserInfo Validation=False;Jet OLEDB:Limited DB Caching=False;Jet OLEDB:Bypass ChoiceField Validation=False" \s\"SELECT `Building`, `Floor`, `Room/Area` FROM `Sheet1$` WHERE ((`Extent of damage score` = '0')) ORDER BY `Sample`" \l "23" \b "191" \h}
|
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Mail Merge to create specific number of table rows
|
flackend | Mail Merge | 4 | 12-01-2023 02:49 PM |
| Using Mail Merge to create summary report in ONE document | ChandaS | Mail Merge | 1 | 12-19-2014 10:16 PM |
Would like to mail merge excel spreadsheet with word doc and create new page when a catagory changes
|
esherwood | Mail Merge | 1 | 07-21-2014 09:55 PM |
How to use mail merge to create a list sorted by category in Word
|
elisa2013 | Mail Merge | 5 | 03-14-2014 02:35 AM |
Urgent Supprt Need to Create Mail Merge letter
|
risnasmhd | Mail Merge | 1 | 09-29-2013 08:11 PM |