Targeting subforms to merge to word

L

LJG

I have a tabbed form with a number of subforms and wonder if anyone can
point me in the correct direction as to the targetting of the data to merge
to Word.

Were I get the problem is getting combo box data

My Current code, which gets me the main form data is:

Private Sub printquote_Click()
Dim strLetter As String
strLetter = "C:\database\Forms\quote.doc"

Dim ObjWord As Word.Application
Set ObjWord = CreateObject("Word.Application")
With ObjWord
.Visible = True
.Documents.Open (strLetter)
.ActiveDocument.Bookmarks("company").Select
.Selection.Text = (CStr(Forms![frmQuote]![txtcompany]))
.ActiveDocument.Bookmarks("qty").Select
.Selection.Text = (CStr(Forms![frmQuote].[tblSoftOrder_subform]![qty]))
.ActiveDocument.Bookmarks("epos_soft").Select

This is were is stops>>>>>>

.Selection.Text =
(CStr(Forms![frmQuote].[tblSoftOrder_subform]![cbosoft].[Column](1)))
.ActiveDocument.Bookmarks("linesum").Select
.Selection.Text =
(CStr(Forms![frmQuote].[tblSoftOrder_subform]![linetotal]))
End With
ObjWord.ActiveDocument.PrintOut Background:=False
ObjWord.ActiveDocument.PrintOut , , , , , , , 1
ObjWord.ActiveDocument.Close SaveChanges:=wdDoNotSaveChanges
ObjWord.Quit

Also, as thier could well be a number of itms to add to the page, I need it
to add as many rows as possible

Any help with this would be appreciated.

Les
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top