mailMerge from query

J

judith

I have been able to mailmerge from a table in the open access database but
when I change the code
Dim objWord As Word.Document
Set objWord = GetObject("C:\Documents and
Settings\judith\Desktop\testbed\mailMergeTest.doc", "Word.Document")
' Make Word visible.
objWord.Application.Visible = True
' Set the mail merge data source
objWord.MailMerge.OpenDataSource _
Name:="C:\Documents and Settings\judith\My Documents\working copies\"
& _
"systemNew.mdb", _
LinkToSource:=True,
Connection:="TABLE clients", _
SQLStatement:="SELECT * FROM [clients]"

to Connection:="QUERY mailingBase3", _
SQLStatement:="SELECT * FROM [mailingBase3]"
it does not work and gives me a list of tables to select from. There are no
queries in the list.

Also is it possible to have an Open dialogue box to choose the word document
from rather than hard code the location please

Thanks
 
Top