I
idsck
hi Guys,
I am new to VBA. Hope to get help here.
I am trying to import data from Access to Word by using word'
bookmark/Dot file. Anyhow, it did put all the data/Rows to Word, but i
all stick together. My question is how do I seperate those data . Th
Code that I used as below. Thanks in advance
Dim rsMyRS As Recordset
Set rsMyRS = Me.Tsubform2.Form.Recordset
Dim objWord9 As Object
Set objWord9 = CreateObject("Word.Application")
objWord9.Documents.Add _
Application.CurrentProject.Path & "\Notes.dot"
objWord9.Visible = True
If Not rsMyRS.EOF Then rsMyRS.MoveFirst
Do While Not rsMyRS.EOF
With objWord9.ActiveDocument.Bookmarks
.Item("DATE").Range.Text = Format(Forms!Tform!Tsubform2!DATE)
.Item("NOTES").Range.Text = Forms!Tform!Tsubform2!NOTES
rsMyRS.MoveNext
End With
Loo
I am new to VBA. Hope to get help here.
I am trying to import data from Access to Word by using word'
bookmark/Dot file. Anyhow, it did put all the data/Rows to Word, but i
all stick together. My question is how do I seperate those data . Th
Code that I used as below. Thanks in advance
Dim rsMyRS As Recordset
Set rsMyRS = Me.Tsubform2.Form.Recordset
Dim objWord9 As Object
Set objWord9 = CreateObject("Word.Application")
objWord9.Documents.Add _
Application.CurrentProject.Path & "\Notes.dot"
objWord9.Visible = True
If Not rsMyRS.EOF Then rsMyRS.MoveFirst
Do While Not rsMyRS.EOF
With objWord9.ActiveDocument.Bookmarks
.Item("DATE").Range.Text = Format(Forms!Tform!Tsubform2!DATE)
.Item("NOTES").Range.Text = Forms!Tform!Tsubform2!NOTES
rsMyRS.MoveNext
End With
Loo