#1
|
|||
|
|||
MySQL data source
We have our data source as an Access 2016 database.
I have some VBA code to connect the mailmerge data, works great! SQL statement looks like this: Code:
"SELECT * FROM [qryJobsCollate] WHERE ([JobNumber]=" & strJobNumber & " AND qryJobsCollate.CStatusID<>5 AND qryJobsCollate.CStatusID<>7);" I have an ODBC driver installed, and that works well for Excel to connect to MySQL and do what it needs to do. But Word is not playing the game. Some of the difficulties... MySQL only has tables, no queries. So if Word is to include the query statement, it's going to include joins be >250 characters... Code:
SELECT tblJobs.JobNumber, tblJobs.JobName, tblClients.CompanyName, tblPeople.FirstName, tblPeople.FullName, tblClients.Address1, tblClients.Address2C, tblPeople.Email, tblJobClientLink.CStatusID FROM tblPeople INNER JOIN (tblJobs INNER JOIN (tblClients INNER JOIN tblJobClientLink ON tblClients.ID = tblJobClientLink.ClientID) ON tblJobs.JobID = tblJobClientLink.JobID) ON tblPeople.ID = tblJobClientLink.ContactID WHERE (((tblJobClientLink.CStatusID)<>5 And (tblJobClientLink.CStatusID)<>7)); I'm leaning towards writing some intermittent code that grabs the data out of MySQL, and puts it into another format (eg Excel spreadsheet) for Word to MailMerge from. |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Word & Excel 2010 - Best Options To Auto Insert MySQL & Excel Data? | Hoser | Word | 1 | 03-17-2017 03:47 PM |
Share my data on via MYSQL??? | cwksr | Excel | 0 | 08-24-2014 03:23 AM |
How to populate cells in Sheet2 with Data Source query using cell data from Sheet1 | bobznkazoo | Excel | 2 | 03-27-2014 11:14 AM |
Mail Merge / DSN / Data Link / MySQL | Bob Young | Mail Merge | 5 | 05-18-2012 03:44 PM |
Edit Data Source- Linking template charts to new data | lbf | PowerPoint | 0 | 10-28-2011 12:19 PM |