View Single Post
 
Old 01-05-2016, 05:49 AM
jmo jmo is offline Windows 7 32bit Office 2010 32bit
Novice
 
Join Date: Dec 2015
Posts: 7
jmo is on a distinguished road
Default

The document is a contracting document with clauses that are either included or excluded depending upon certain factors. I put in custom document properties which are set via combo boxes. These clauses are stored in fields that are displayed IF a custom document property (via combobox) is set.

When the button to 'run' is pushed it updates all the fields to display the correct clauses. This piece works fine.

It's mail merging the queries which contain access VB that are the problem.

The output from your macro is as follows:

Quote:
Mail Merge Data Source Name:
H:\RDS\ASSESS\2016\Database\2016 OCJP Grants.mdb
Mail Merge Connect String:

Mail Merge Query String:
SELECT [2016 OCJP Grants TABLE].AUTH_AGENCY, [2016 OCJP Grants TABLE].FUND_SOURC, [2016 OCJP Grants TABLE].[2016 EDISON CONTRACT], [2016 OCJP Grants TABLE].BEGDATE, [2016 OCJP Grants TABLE].ENDDATE, [2016 OCJP Grants TABLE].[CFDA #], [2016 OCJP Grants TABLE].[VENDOR ID], [2016 OCJP Grants TABLE].[2016 SPEED CHART], [2016 OCJP Grants TABLE].[ACCOUNT CODE], [2016 OCJP Grants TABLE].FED_ID, [2016 OCJP Grants TABLE].PROJ_DIR, [2016 OCJP Grants TABLE].TITLE_DIR, [2016 OCJP Grants TABLE].ADDR1_DIR, [2016 OCJP Grants TABLE].ADDR2_DIR, [2016 OCJP Grants TABLE].CITY_DIR, [2016 OCJP Grants TABLE].PHONE_DIR, [2016 OCJP Grants TABLE].ZIP_DIR, [2016 OCJP Grants TABLE].EMAIL_DIR, [2016 OCJP Grants TABLE].FEDFUNDS16, [2016 OCJP Grants TABLE].MTCH_FUNDS16, [2016 OCJP Grants TABLE].FEDFUNDS17, [2016 OCJP Grants TABLE].MTCH_FUNDS17, [2016 OCJP Grants TABLE].ALL_FUNDS, [2016 OCJP Grants TABLE].MGR_NAM, [2016 OCJP Grants TABLE].MGR_GENDER, [2016 OCJP Grants TABLE].PHONE_MGR, [2016 OCJP Grants TABLE].MGR_EMAIL, [2016 OCJP Grants TABLE].[Agency FY End Date], English([ALL_FUNDS]) AS WORD_NUM, SpeedtoFain([2016 Speed Chart]) AS FAIN, SpeedtoDate([2016 Speed Chart]) AS AwardDate, SpeedtoAmount([2016 Speed Chart]) AS AwardAmount, SpeedtoAA([2016 Speed Chart]) AS AwardingAgency, SpeedtoContact([2016 Speed Chart]) AS FederalContact, SpeedtoPhone([2016 Speed Chart]) AS ContactPhone, SpeedtoAwardName([2016 Speed Chart]) AS GrantName, NumofMonths([BegDate],[EndDate]) AS NumMonths, ConvertNumberstoEnglish([NumMonths]) AS MonthWords
FROM [2016 OCJP Grants TABLE]
WHERE ((([2016 OCJP Grants TABLE].MGR_NAM)=""John Doe""));
If I copy this directly into the SQLString and run it then it skips all the Access VB sections but if I manually do it and connect as DDE it works fine.
Reply With Quote