Word has only ever been able to use a single flat file as a data source. It
has never been able to use two tables.

Signature
Hope this helps.
Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.
Doug Robbins - Word MVP
This is the code I've been using under 2000 for quite some time and it has
worked fine.
Query = _
"SELECT [Clients].[ClientsID], [Clients].[Last Name], " & _
"[Clients].[Active], [Retirement].* FROM [Clients],[Retirement] "
Query2 = _
"WHERE Retirement.[Balance Due] <> 0.0 AND " & _
"[Retirement].[Quarter] = '" & mShortQuarter & "' AND " & _
"[Clients].[ClientsID] = [Retirement].[LinkToParent] AND " & _
"[Clients].[Active] = 'Active' " & _
"ORDER BY [Clients].[Last Name]"
Dim M As Word.MailMerge
Set M = Wrd.Documents(1).MailMerge
M.MainDocumentType = wdFormLetters
M.Destination = wdSendToNewDocument
Call M.OpenDataSource(Name:=GetDbName(), sqlstatement:=Query,
sqlStatement1:=Query2)
Call M.Execute
> Word has only ever been able to use a single flat file as a data source.
> It has never been able to use two tables.
[quoted text clipped - 10 lines]
>>
>> Thanks for any help.
Doug Robbins - Word MVP - 23 Feb 2006 05:09 GMT
Check out the OpenDataSource() function in the Visual Basic Help file.
There are probably more parameters that you need to specify due to
additional connection methods that were introduced in XP.

Signature
Hope this helps.
Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.
Doug Robbins - Word MVP
> This is the code I've been using under 2000 for quite some time and it has
> worked fine.
[quoted text clipped - 32 lines]
>>>
>>> Thanks for any help.
Peter Jamieson - 23 Feb 2006 10:01 GMT
One thing you will almost certainly have to do is to follow the instructions
in this Knowledgebase article:
>> "Opening This Will Run the Following SQL Command" Message When You Open a
>> Word Document"
>>
>> at
>>
>> http://support.microsoft.com?kbid=825765
(The setting affects what happens when you open a data source in VBA as
well)
Peter Jamieson
> This is the code I've been using under 2000 for quite some time and it has
> worked fine.
[quoted text clipped - 32 lines]
>>>
>>> Thanks for any help.