In that case, you could still use Mail Merge:
http://word.mvps.org/FAQs/MailMerge/...AMailMerge.htm
I see that you have already posted in the Word Programming area. Hopefully
someone over there will be able to help you out. This is really a Word
issue; you control Access from Word…Access is kind of just sitting there,
dormant.
Good luck!!
Ryan---
--
RyGuy
"iris" wrote:
> Hi Ryan,
>
> thank you for your quick reply.
>
> I open the form from WORD and not from Access... the data base is in access...
>
> The enduser is supposed to use this data in his document.
>
> I need the code in word vba that pulls the data from access to textboxes in
> a word form...
>
>
> "ryguy7272" wrote:
>
> > 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---
> >
> >
> > --
> > RyGuy
> >
> >
> > "iris" wrote:
> >
> > > Hello everybody.
> > >
> > > I have a table in access with 12 columns.
> > >
> > > I have created a form in WORD with 1 combobox and 12 textboxes.
> > >
> > > I need to populate the textboxes with values when I choose a value in the
> > > combobox...
> > >
> > > can anyone tell me how to do that?
> > >