View Single Post
 
Old 12-22-2015, 11:08 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 Merge Object and not displaying Access Queries with VBA

I have a database where some queries utilize VBA code to output text for mail merge.

To make these queries appear during a mail merge I have to check the advanced option 'Confirm File Format on Open'. Then select DDE when doing the merge.

If I try to merge with VBA code within a word document:

ActiveDocument.MailMerge.OpenDataSource Name:=dbpath, ConfirmConversions:=True, ReadOnly:=False, LinkToSource:=False, AddToRecentFiles:=False, PasswordDocument:="", PasswordTemplate:="", WritePasswordDocument:="", WritePasswordTemplate:="", Revert:=False, Connection:="", Format:=wdOpenFormatAuto, SubType:=wdMergeSubType2000

It successfully opens the database but the queries that have the VBA code are absent as if the 'Confirm file format..' is unchecked. How can I make them appear when doing a merge with VBA code?
Reply With Quote