Lee:
The trick is to include your underlying table's KEY FIELD in the form from which you are intiating the merge. (On the form, I set that field's Visible property to 'no.') Then... create a query that has the same table's KEY FIELD in it, with the Criteria set to the form's entry of that key field. For example: [forms]![form name]![key field name] as the criteria. That way the query will find the data only currently showing in the form.
Then... create a command button in the form that runs the query, and intitiate the merge. Here is the code that was given to me that works as the OnClick property (Build Event):
=======================
Dim objWord As Word.Document
Set objWord = GetObject("DocumentName", "Word.Document")
' Make Word visible.
objWord.Application.Visible = True
' Set the mail merge data source
objWord.MailMerge.OpenDataSource Name:="DatabaseName", _
LinkToSource:=True, _
Connection:="QUERY QueryName"
objWord.MailMerge.Destination = wdSendToNewDocument
objWord.MailMerge.Execute
'The following line must follow the Execute statement because the PrintBackground property is available only when a document window is active. Without this line of code, the function will end before Word can print the merged document.
objWord.Application.Options.PrintBackground = False
objWord.Application.ActiveDocument.PrintOut
End Sub
=======================
The Word document is a mail merge document and has to have the fields from the merge in it. Go through the mail merge function in Word to set up the document, with the data source set to the database query... then use the 'enter merge field' button to place the fields in the document.
This works every time. If you're working on a network, be sure to put the true path to the document, and not the mapped path.
Hope this helps.
Tom