I get the message DatabaseName Can't find the field 'DirectorCoordinator'
entered in your expression. Run Time Error 2465
I am using bookmarks to obtain data from a table for this letter.
Below is my code and if you can take a look at it and please tell me what
is
incorrect.
Thanks,
Sub PrintTracerSurveyRe****t(sfrmRe****ts)
Dim objWord As Word.Application
Dim objDoc As Word.Do***ent
Dim objBookmarks As Bookmark
'Launch Word and load the JCAHOTracerPreSurveyRe****t template
Set objWord = New Word.Application
objWord.Visible = True
Set objDoc = objWord.Do***ents.Add("S:\Quality & Process
Improvement\QPI\JCAHO PreSurvey Tool\Do***ents\JCAHOPreSurveyRe****t3.dot")
'Add information using predefined bookmarks
With objDoc.Bookmarks
.Item("DirectorCoordinator").Range.Text =
[sfrmRe****ts].Form!DirectorCoordinator
.Item("SurveyID").Range.Text = [sfrmRe****ts].Form!SurveyID
.Item("SurveyDate").Range.Text = [sfrmRe****ts].Form!SurveyDate
.Item("SubSiteName").Range.Text =
[sfrmRe****ts].Form!SubSiteName
.Item("Standard").Range.Text = [sfrmRe****ts].Form!Standard
.Item("Observation").Range.Text =
[sfrmRe****ts].Form!Observation
.Item("Recommendation").Range.Text =
[sfrmRe****ts].Form!Recommendation
.Item("FollowupComments").Range.Text =
[sfrmRe****ts].Form!FollowupComments
End With
objWord.PrintOut
objDoc.Close wdDoNotSaveChanges
objWord.Quit
End Sub
--
Kenny G