Merging with Access

J

jbc

Hello,

I have a template that I created several years ago. I'm now using it in
Word 2003 that merges with a query in Access 2003. I recorded the merging
process and am getting 2 prompts that I would rather not get.

I want to be able to double click on the word template and have the macro
merge the template with the access query.

The prompts are: Opening this document will run the following SQL command.
Select *From[qryLetterNewMember] Data from your database will be placed in
the document. Do you want to continue? YES NO

Confirm Data Source: I choose MS Access Database via DDE *.mdb *.mde

this is the code:

ActiveDocument.MailMerge.OpenDataSource Name:= _
"C:\xxxxx\Membership.mdb" _
, ConfirmConversions:=False, ReadOnly:=False, LinkToSource:=True, _
AddToRecentFiles:=False, PasswordDocument:="", PasswordTemplate:="", _
WritePasswordDocument:="", WritePasswordTemplate:="", Revert:=False, _
Format:=wdOpenFormatAuto, Connection:="QUERY qryLetterNewMember", _
SQLStatement:="SELECT * FROM [qryLetterNewMember]",
SQLStatement1:="", _
SubType:=wdMergeSubTypeOther

With ActiveDocument.MailMerge
.Destination = wdSendToNewDocument
.Execute
End With


What am I doing wrong? Thanks.

jbc
 
P

Peter Jamieson

The prompts are: Opening this document will run the following SQL
command.
Select *From[qryLetterNewMember] Data from your database will be placed in
the document. Do you want to continue? YES NO
See

http://support.microsoft.com/kb/825765

SQLStatement1:="", _
SubType:=wdMergeSubTypeOther

Try

SubType:=wdMergeSubTypeWord2000

Peter Jamieson

jbc said:
Hello,

I have a template that I created several years ago. I'm now using it in
Word 2003 that merges with a query in Access 2003. I recorded the merging
process and am getting 2 prompts that I would rather not get.

I want to be able to double click on the word template and have the macro
merge the template with the access query.

The prompts are: Opening this document will run the following SQL
command.
Select *From[qryLetterNewMember] Data from your database will be placed in
the document. Do you want to continue? YES NO

Confirm Data Source: I choose MS Access Database via DDE *.mdb *.mde

this is the code:

ActiveDocument.MailMerge.OpenDataSource Name:= _
"C:\xxxxx\Membership.mdb" _
, ConfirmConversions:=False, ReadOnly:=False, LinkToSource:=True, _
AddToRecentFiles:=False, PasswordDocument:="",
PasswordTemplate:="", _
WritePasswordDocument:="", WritePasswordTemplate:="",
Revert:=False, _
Format:=wdOpenFormatAuto, Connection:="QUERY qryLetterNewMember", _
SQLStatement:="SELECT * FROM [qryLetterNewMember]",
SQLStatement1:="", _
SubType:=wdMergeSubTypeOther

With ActiveDocument.MailMerge
.Destination = wdSendToNewDocument
.Execute
End With


What am I doing wrong? Thanks.

jbc
 
J

jbc

Thank you Peter.

Peter Jamieson said:
The prompts are: Opening this document will run the following SQL
command.
Select *From[qryLetterNewMember] Data from your database will be placed in
the document. Do you want to continue? YES NO
See

http://support.microsoft.com/kb/825765

SQLStatement1:="", _
SubType:=wdMergeSubTypeOther

Try

SubType:=wdMergeSubTypeWord2000

Peter Jamieson

jbc said:
Hello,

I have a template that I created several years ago. I'm now using it in
Word 2003 that merges with a query in Access 2003. I recorded the merging
process and am getting 2 prompts that I would rather not get.

I want to be able to double click on the word template and have the macro
merge the template with the access query.

The prompts are: Opening this document will run the following SQL
command.
Select *From[qryLetterNewMember] Data from your database will be placed in
the document. Do you want to continue? YES NO

Confirm Data Source: I choose MS Access Database via DDE *.mdb *.mde

this is the code:

ActiveDocument.MailMerge.OpenDataSource Name:= _
"C:\xxxxx\Membership.mdb" _
, ConfirmConversions:=False, ReadOnly:=False, LinkToSource:=True, _
AddToRecentFiles:=False, PasswordDocument:="",
PasswordTemplate:="", _
WritePasswordDocument:="", WritePasswordTemplate:="",
Revert:=False, _
Format:=wdOpenFormatAuto, Connection:="QUERY qryLetterNewMember", _
SQLStatement:="SELECT * FROM [qryLetterNewMember]",
SQLStatement1:="", _
SubType:=wdMergeSubTypeOther

With ActiveDocument.MailMerge
.Destination = wdSendToNewDocument
.Execute
End With


What am I doing wrong? Thanks.

jbc
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top