HaworthBantam
Programmer
I have written a VB6 app that opens a Word97 template and automatically feeds data into it from an Access database.
Relevant sections of the code are below....
Set wdMyApp = New Word.Application
Set wdMyDoc = wdMyApp.Documents.Add([pathway to template here])
wdMyApp.Documents([filename here]).Activate
With wdMyApp
.ActiveDocument.Bookmarks("bkInjuredPerson"
.Select
.Selection.Text = frmViewAllRecords.txtViewAllName
The code goes on to select and complete various other bookmarks and all works fine until......
.ActiveDocument.FormFields("chkFemale"
.CheckBox.Value = True
This last particular line throws up an error......
5941 - The requested member of the collection does not exist.
The check box is a valid field within the template. I'm obviously missing something here and it wouldn't surprise me if it was something stupid. Any help you folks out there could give me would be most appreciated.
Relevant sections of the code are below....
Set wdMyApp = New Word.Application
Set wdMyDoc = wdMyApp.Documents.Add([pathway to template here])
wdMyApp.Documents([filename here]).Activate
With wdMyApp
.ActiveDocument.Bookmarks("bkInjuredPerson"
.Selection.Text = frmViewAllRecords.txtViewAllName
The code goes on to select and complete various other bookmarks and all works fine until......
.ActiveDocument.FormFields("chkFemale"
This last particular line throws up an error......
5941 - The requested member of the collection does not exist.
The check box is a valid field within the template. I'm obviously missing something here and it wouldn't surprise me if it was something stupid. Any help you folks out there could give me would be most appreciated.