Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
![]()
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 "Bill S." wrote in message ... 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 "Doug Robbins - Word MVP" wrote in message ... 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. -- 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 "Bill S." wrote in message ... Hi, Under Word 2000 the mail merge worked, but now that Office/Word 2002 has been installed when the mail merge is executed, it brings up a 'Select Table' dialog showing the list of tables within the database. There are two problems with this dialog. The first is that it only allows one table to be chosen (when there are two tables involved in the mail merge query), and second the dialog is just not wanted! Does anybody have any ideas as to how to resolve this problem? Thanks for any help. |
Reply |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
HOWTO: Mail Merge Select? | Mailmerge | |||
Differences between 2002 and 2000 | Microsoft Word Help | |||
Automate a mail merge in Word 2002 from a macro in Access 2002 | Mailmerge | |||
How do I find mail merge helper in word 2002 | Microsoft Word Help | |||
How do I find mail merge helper in word 2002 | Microsoft Word Help |