Hello,
back for some help. Almost finished by project but coming up with a type mismatch error 13 which I just cannot solve.
The code behind my cmdbutton exports date from my form to a MS Word Template.
Data is stored in textboxes and combo boxes. When I run the code I get the error message at the code line which should export data from a combo.
The following codes searches for the template:
[/CODE]
This is the code that export data from a text box to the template:
The error highlights the line: objWord.Selection.Text = Me.STATUS
Data in the field Status is short text.
Appreciate your help. Thank you
back for some help. Almost finished by project but coming up with a type mismatch error 13 which I just cannot solve.
The code behind my cmdbutton exports date from my form to a MS Word Template.
Data is stored in textboxes and combo boxes. When I run the code I get the error message at the code line which should export data from a combo.
The following codes searches for the template:
Code:
strPath = DLookup("[TemplateLocation]", "TablePath", "[TemplateID]='" & Me.[txtpathLetter] & "'")
Set objWord = CreateObject("Word.Application")
objWord.Visible = False
objWord.Documents.Add strPath
[/CODE]
This is the code that export data from a text box to the template:
Code:
objWord.ActiveDocument.Bookmarks("STATUS").Select
objWord.Selection.Text = Me.STATUS
The error highlights the line: objWord.Selection.Text = Me.STATUS
Data in the field Status is short text.
Appreciate your help. Thank you