I'm trying to imagine your design; nothing I can think of makes sense. Have
you taken a look at Mail Merge. That may work for you. As an alternative,
you can set up a Form, choose the appropriate record(s) and then run some VBA
code to push all the data from Access to Word. Take a look at this, and
change the variable names to match your own:
Option Compare Database
Sub PatientForm()
Dim appWord As Word.Application
Dim doc As Word.Document
Dim objWord As Object
On Error Resume Next
err.Clear
Set appWord = GetObject(, "Word.Application")
Set objWord = CreateObject("Word.Application")
If err.Number <> 0 Then
objWord.Documents.Open CurrentProject.Path & "\test.doc"
objWord.Visible = True
End If
'Set doc = appWord.Documents.Open("C:\PatientForm.doc", , True)
Set doc = appWord.Documents.Open(CurrentProject.Path & "\PatientForm.doc", ,
True)
With doc
..FormFields("LastName").Result = Forms!SearchForm!frmsubClients.Form.LastName
..FormFields("FirstName").Result =
Forms!SearchForm!frmsubClients.Form.FirstName
..FormFields("ConsultDate").Result =
Forms!SearchForm!frmsubClients.Form.ConsultDate
..Visible = True
..Activate
End With
Set doc = Nothing
Set appWord = Nothing
Exit Sub
errHandler:
MsgBox err.Number & ": " & err.Description
End Sub
Regards,
Ryan---