E
ehorde
After spending ALL DAY searching the entire WEB I have found a lot of
posts asking this same question but not one answer.
I thought I's throw it up again.
The button on my form does this. * From Mergit() *
Dim objWord As Word.Document
Set objWord = GetObject("H:\Contract Admin Database\Merge Documents
\WIP\Closings\Closing Packet Documents\Test - closing packet EM.doc",
"Word.Document")
objWord.Application.Visible = True
' Set the mail merge data source as the Northwind database.
objWord.MailMerge.OpenDataSource _
Name:="H:\Contract Admin Database\Development\CA.mdb", _
LinkToSource:=True, _
Connection:="Query Q_CA_MergeDocsMaster", _
SQLStatement:="SELECT * FROM [Q_CA_MergeDocsMaster] WHERE
((Q_CA_MergeDocsMaster.Job_Key)=[Forms]![WordMerge]![Job_Key])", _
SubType:=wdMergeSubTypeWord2000
objWord.MailMerge.Execute
The Word document opens and the merge even executes, but totally
ignoring the WHERE clause.
Can anyone tell me why the WHERE part is ignored by the merge?
posts asking this same question but not one answer.
I thought I's throw it up again.
The button on my form does this. * From Mergit() *
Dim objWord As Word.Document
Set objWord = GetObject("H:\Contract Admin Database\Merge Documents
\WIP\Closings\Closing Packet Documents\Test - closing packet EM.doc",
"Word.Document")
objWord.Application.Visible = True
' Set the mail merge data source as the Northwind database.
objWord.MailMerge.OpenDataSource _
Name:="H:\Contract Admin Database\Development\CA.mdb", _
LinkToSource:=True, _
Connection:="Query Q_CA_MergeDocsMaster", _
SQLStatement:="SELECT * FROM [Q_CA_MergeDocsMaster] WHERE
((Q_CA_MergeDocsMaster.Job_Key)=[Forms]![WordMerge]![Job_Key])", _
SubType:=wdMergeSubTypeWord2000
objWord.MailMerge.Execute
The Word document opens and the merge even executes, but totally
ignoring the WHERE clause.
Can anyone tell me why the WHERE part is ignored by the merge?