Hi,
I am exporting data from a form in Access to Word using Bookmarks. I am using Access 97 and Word 97. Now the exporting works fine except when the users go back in database and update the same record and try to export the currently updated record, then my code is able to find the file and bring back that file with any changes made in the Word Document (like if the clients have added graphics or anything), but the Problem is:
It concatenates all the new values with the old values on the word document.
For Example :
I have a book mark on hte word document for title, so if the title is:
Problem with Bookmarks
then when I update the same record and change the title to:
Problem With Bookmarks on Word
and try to export the updated version then it brings up the old word file like this:
Title: Problem with BookmarksProblem with Bookmarks on Word
So can anyone please help to solve this problem of concatenating these strings so that the new word document will come up like:
Title: Problem with Bookmarks on Word.
Any help will be really appreciated.
The following is the code that I am using to export the data to word:
Private Sub Command137_Click()
On Error GoTo Err_Command137_Click
Dim objWord As Object
Set objWord = CreateObject("Word.Application"
Dim WordTemplate As String
'WordTemplate = "C:\WINNT\Profiles\c62dr60\desktop\Stemp.dot"
Dim FoundFile As Boolean
'WordTemplate = "G:\RModi\updates\Stemp.dot"
'Functional Area Block
'********************************************************************************
'********************************************************************************
'CHECKING FOR AN EXISTING DOCUMENT
Dim CurWord As String
Dim ProjectNum As String
ProjectNum = Me.ReferenceNumberTxt
CurWord = "G:\RModi\updates\" & ProjectNum & ".doc"
With Application.FileSearch
.LookIn = "G:\RModi\updates\"
'.LookIn = "C:\WINNT\Profiles\c62dr60\desktop\"
.FileName = ProjectNum & ".doc"
If .Execute(SortBy:=msoSortbyFileName, _
SortOrder:=msoSortOrderAscending) > 0 Then
MsgBox "There were " & .FoundFiles.Count & _
" file(s) found."
WordTemplate = "G:\RModi\updates\" & ProjectNum & ".doc"
'WordTemplate = "C:\WINNT\Profiles\c62dr60\desktop\Stemp.dot"
FoundFile = True
Else
'WordTemplate = "C:\WINNT\Profiles\c62dr60\desktop\Stemp.dot"
WordTemplate = "G:\RModi\updates\Stemp.dot"
MsgBox "There were no files found."
FoundFile = False
End If
End With
Dim FunctionalAreaNum As Integer
Dim strFunctional As String
'Testing Considerations Block
Dim TestingNum As Integer
Dim strTestingNone As String
Dim strMHS As String
Dim strQIPS As String
Dim strGeoAccess As String
Dim strCapitation As String
Dim strother As String
Dim strTestingAll As String
'Considerations Block
Dim strConsAll As String
Dim strConsNone As String
Dim strConsMHS As String
Dim strConsHipaa As String
Dim strConsOptimed As String
Dim strConsCorp As String
Dim strConsProv As String
Dim strConsSliq As String
Dim strConsEcom As String
Dim strConsPlanmate As String
Dim ConsidOther As String
Dim DB As Database
Set DB = CurrentDb
Dim Quote As String
Quote = Chr$(34)
'Implementation CheckList Block
Dim strImplAll As String
Dim strProgName As String
Dim strProj As String
Dim ImplOther As String
Dim CreatedBy As Recordset
Set CreatedBy = DB.OpenRecordset("SELECT SOWCreatedByTable.CreatedBy From SOWCreatedByTable Where SOWCreatedByTable.[Project#] = " & Quote & Me.ReferenceNumberTxt & Quote & " AND SOWCreatedByTable.[Version] = " & Me.VersionNumberTxt & ";"
Dim strCreatedBy As String
If FoundFile = True Then
With CreatedBy
Do While Not .EOF
If strCreatedBy = "" Then
strCreatedBy = CreatedBy.Fields(0)
ElseIf strCreatedBy <> "" Then
strCreatedBy = strCreatedBy & vbCrLf & _
CreatedBy.Fields(0)
End If
.MoveNext
Loop
End With
With objWord
.Visible = True
.Documents.Open (WordTemplate)
.ActiveDocument.Bookmarks("RefNumber"
.Select
.Selection.text = (CStr(Me.ReferenceNumberTxt & vbNullString))
.ActiveDocument.Bookmarks("Version"
.Select
.Selection.text = (CStr(Me.VersionNumberTxt & vbNullString))
.ActiveDocument.Bookmarks("Activity"
.Select
.Selection.text = (CStr(Me.Activity & vbNullString))
.ActiveDocument.Bookmarks("Assumptions"
.Select
.Selection.text = (CStr(Me.Assumptions & vbNullString))
.ActiveDocument.Bookmarks("CostDescription"
.Select
.Selection.text = (CStr(Me.CostDescription & vbNullString))
.ActiveDocument.Bookmarks("CreatedBy"
.Select
.Selection.text = (CStr(strCreatedBy & vbNullString))
.ActiveDocument.Bookmarks("CreationDate"
.Select
.Selection.text = (CStr(Me.CreateDate & vbNullString))
.ActiveDocument.Bookmarks("EndResearch"
.Select
.Selection.text = (CStr(Me.EndResearch & vbNullString))
.ActiveDocument.Bookmarks("ISLead"
.Select
.Selection.text = (CStr(Me.ISLeadCmb & vbNullString))
.ActiveDocument.Bookmarks("RequestName"
.Select
.Selection.text = (CStr(Me.RequestNameTxt & vbNullString))
.ActiveDocument.Bookmarks("RevisionDate"
.Select
.Selection.text = (CStr(Me.RevisionDate & vbNullString))
.ActiveDocument.Bookmarks("Scope"
.Select
.Selection.text = (CStr(Me.ScopeTxt & vbNullString))
.ActiveDocument.Bookmarks("ServiceRequestDate"
.Select
.Selection.text = (CStr(Me.ServiceRequestDateTxt & vbNullString))
.ActiveDocument.Bookmarks("StartActive"
.Select
.Selection.text = (CStr(Me.StartActive & vbNullString))
.ActiveDocument.Bookmarks("StartResearch"
.Select
.Selection.text = (CStr(Me.StartResearch & vbNullString))
.ActiveDocument.Bookmarks("SystemComplete"
.Select
.Selection.text = (CStr(Me.SystemTestComplete & vbNullString))
FunctionalAreaNum = FunctionalAreaTxt
If FunctionalAreaNum = 1 Then
strFunctional = "Professional Only"
ElseIf FunctionalAreaNum = 2 Then
strFunctional = "Institutional Only"
ElseIf FunctionalAreaNum = 3 Then
strFunctional = "Professional and Institutional"
End If
.ActiveDocument.Bookmarks("FunctionalArea"
.Select
.Selection.text = (CStr(strFunctional & vbNullString))
'******************Testing Considerations Block *******************************
If Me!TestingConsNone.Value = True Then
strTestingNone = "None" & vbCrLf
ElseIf Me!TestingConsNone.Value = False Then
strTestingNone = ""
End If
If Me!TestingConsMHS.Value = True Then
strMHS = "MHS" & vbCrLf
ElseIf Me!TestingConsMHS.Value = False Then
strMHS = ""
End If
If Me!TestingConsQIPS.Value = True Then
strQIPS = "QIPS" & vbCrLf
ElseIf Me!TestingConsQIPS.Value = False Then
strQIPS = ""
End If
If Me!TestingConsCapitation.Value = True Then
strCapitation = "Capitation" & vbCrLf
ElseIf Me!TestingConsCapitation.Value = False Then
strCapitation = ""
End If
If Me!TestingConsGEOAccess.Value = True Then
strGeoAccess = "GeoAccess" & vbCrLf
Else
strGeoAccess = ""
End If
If Me!TestingOtherChk.Value = True Then
strother = "OTHER: " & Me!TestingConsiderationsOther
strTestingAll = strTestingNone & strMHS & strQIPS & strCapitation & strGeoAccess & strother
ElseIf Me!TestingOtherChk.Value = False Then
strother = ""
strTestingAll = strTestingNone & strMHS & strQIPS & strCapitation & strGeoAccess
End If
.ActiveDocument.Bookmarks("TestingCons"
.Select
.Selection.text = (CStr(strTestingAll & vbNullString))
'******************Considerations Block *******************************
If Me!ConsiderationsNone.Value = True Then
strConsNone = "None" & vbCrLf
ElseIf Me!ConsiderationsNone.Value = False Then
strConsNone = ""
End If
If Me!ConsiderationsMHS.Value = True Then
strConsMHS = "MHS Interface" & vbCrLf
ElseIf Me!ConsiderationsMHS.Value = False Then
strConsMHS = ""
End If
If Me!ConsiderationsOptimed.Value = True Then
strConsOptimed = "Optimed" & vbCrLf
ElseIf Me!ConsiderationsOptimed.Value = False Then
strConsOptimed = ""
End If
If Me!ConsiderationsCorpDataWrhse.Value = True Then
strConsCorp = "Corporate Data Warehouse" & vbCrLf
ElseIf Me!ConsiderationsCorpDataWrhse.Value = False Then
strConsCorp = ""
End If
If Me!ConsiderationsProviderDir.Value = True Then
strConsProv = "Provider Directory" & vbCrLf
Else
strConsProv = ""
End If
If Me!ConsiderationsSLIQ.Value = True Then
strConsSliq = "SLIQ" & vbCrLf
Else
strConsSliq = ""
End If
If Me!ConsiderationsHIPAA.Value = True Then
strConsHipaa = "HIPAA" & vbCrLf
Else
strConsHipaa = ""
End If
If Me!ConsiderationsECommerce.Value = True Then
strConsEcom = "ECommerce" & vbCrLf
Else
strConsEcom = ""
End If
If Me!ConsiderationsPlanmate.Value = True Then
strConsPlanmate = "Planmate" & vbCrLf
Else
strConsPlanmate = ""
End If
If Me!ConsiderationsOtherChk.Value = True Then
ConsidOther = "OTHER: " & Me!ConsiderationsOther
strConsAll = strConsNone & strConsMHS & strConsOptimed & strConsCorp & strConsProv & strConsSliq & strConsEcom & strConsPlanmate & ConsidOther
ElseIf Me!ConsiderationsOtherChk.Value = False Then
ConsidOther = ""
strConsAll = strConsNone & strConsMHS & strConsOptimed & strConsCorp & strConsProv & strConsSliq & strConsEcom & strConsPlanmate & ConsidOther
End If
.ActiveDocument.Bookmarks("Considerations"
.Select
.Selection.text = (CStr(strConsAll & vbNullString))
'******************Implementation Block *******************************
If Me!ProgramNameChk.Value = True Then
strProgName = "Program: " & Me!ImplChecklistProgramName & vbCrLf
Else
strProgName = ""
End If
If Me!ImplChecklistProjanChk.Value = True Then
strProj = "Program Names Added to Projan" & vbCrLf
Else
strProj = ""
End If
If Me!ImplOtherChk.Value = True Then
ImplOther = "Other: " & Me!ImplChecklistOther & vbCrLf
Else
ImplOther = ""
End If
strImplAll = strProgName & strProj & ImplOther
.ActiveDocument.Bookmarks("Implementation"
.Select
.Selection.text = (CStr(strImplAll & vbNullString))
End With
Else
With CreatedBy
Do While Not .EOF
If strCreatedBy = "" Then
strCreatedBy = CreatedBy.Fields(0)
ElseIf strCreatedBy <> "" Then
strCreatedBy = strCreatedBy & vbCrLf & _
CreatedBy.Fields(0)
End If
.MoveNext
Loop
End With
With objWord
.Visible = True
.Documents.Add (WordTemplate)
.ActiveDocument.Bookmarks("RefNumber"
.Select
.Selection.text = (CStr(Me.ReferenceNumberTxt & vbNullString))
.ActiveDocument.Bookmarks("Version"
.Select
.Selection.text = (CStr(Me.VersionNumberTxt & vbNullString))
.ActiveDocument.Bookmarks("Activity"
.Select
.Selection.text = (CStr(Me.Activity & vbNullString))
.ActiveDocument.Bookmarks("Assumptions"
.Select
.Selection.text = (CStr(Me.Assumptions & vbNullString))
.ActiveDocument.Bookmarks("CostDescription"
.Select
.Selection.text = (CStr(Me.CostDescription & vbNullString))
.ActiveDocument.Bookmarks("CreatedBy"
.Select
.Selection.text = (CStr(strCreatedBy & vbNullString))
.ActiveDocument.Bookmarks("CreationDate"
.Select
.Selection.text = (CStr(Me.CreateDate & vbNullString))
.ActiveDocument.Bookmarks("EndResearch"
.Select
.Selection.text = (CStr(Me.EndResearch & vbNullString))
.ActiveDocument.Bookmarks("ISLead"
.Select
.Selection.text = (CStr(Me.ISLeadCmb & vbNullString))
.ActiveDocument.Bookmarks("RequestName"
.Select
.Selection.text = (CStr(Me.RequestNameTxt & vbNullString))
.ActiveDocument.Bookmarks("RevisionDate"
.Select
.Selection.text = (CStr(Me.RevisionDate & vbNullString))
.ActiveDocument.Bookmarks("Scope"
.Select
.Selection.text = (CStr(Me.ScopeTxt & vbNullString))
.ActiveDocument.Bookmarks("ServiceRequestDate"
.Select
.Selection.text = (CStr(Me.ServiceRequestDateTxt & vbNullString))
.ActiveDocument.Bookmarks("StartActive"
.Select
.Selection.text = (CStr(Me.StartActive & vbNullString))
.ActiveDocument.Bookmarks("StartResearch"
.Select
.Selection.text = (CStr(Me.StartResearch & vbNullString))
.ActiveDocument.Bookmarks("SystemComplete"
.Select
.Selection.text = (CStr(Me.SystemTestComplete & vbNullString))
FunctionalAreaNum = FunctionalAreaTxt
If FunctionalAreaNum = 1 Then
strFunctional = "Professional Only"
ElseIf FunctionalAreaNum = 2 Then
strFunctional = "Institutional Only"
ElseIf FunctionalAreaNum = 3 Then
strFunctional = "Professional and Institutional"
End If
.ActiveDocument.Bookmarks("FunctionalArea"
.Select
.Selection.text = (CStr(strFunctional & vbNullString))
'******************Testing Considerations Block *******************************
If Me!TestingConsNone.Value = True Then
strTestingNone = "None" & vbCrLf
ElseIf Me!TestingConsNone.Value = False Then
strTestingNone = ""
End If
If Me!TestingConsMHS.Value = True Then
strMHS = "MHS" & vbCrLf
ElseIf Me!TestingConsMHS.Value = False Then
strMHS = ""
End If
If Me!TestingConsQIPS.Value = True Then
strQIPS = "QIPS" & vbCrLf
ElseIf Me!TestingConsQIPS.Value = False Then
strQIPS = ""
End If
If Me!TestingConsCapitation.Value = True Then
strCapitation = "Capitation" & vbCrLf
ElseIf Me!TestingConsCapitation.Value = False Then
strCapitation = ""
End If
If Me!TestingConsGEOAccess.Value = True Then
strGeoAccess = "GeoAccess" & vbCrLf
Else
strGeoAccess = ""
End If
If Me!TestingOtherChk.Value = True Then
strother = "OTHER: " & Me!TestingConsiderationsOther
strTestingAll = strTestingNone & strMHS & strQIPS & strCapitation & strGeoAccess & strother
ElseIf Me!TestingOtherChk.Value = False Then
strother = ""
strTestingAll = strTestingNone & strMHS & strQIPS & strCapitation & strGeoAccess
End If
.ActiveDocument.Bookmarks("TestingCons"
.Select
.Selection.text = (CStr(strTestingAll & vbNullString))
'******************Considerations Block *******************************
If Me!ConsiderationsNone.Value = True Then
strConsNone = "None" & vbCrLf
ElseIf Me!ConsiderationsNone.Value = False Then
strConsNone = ""
End If
If Me!ConsiderationsMHS.Value = True Then
strConsMHS = "MHS Interface" & vbCrLf
ElseIf Me!ConsiderationsMHS.Value = False Then
strConsMHS = ""
End If
If Me!ConsiderationsOptimed.Value = True Then
strConsOptimed = "Optimed" & vbCrLf
ElseIf Me!ConsiderationsOptimed.Value = False Then
strConsOptimed = ""
End If
If Me!ConsiderationsCorpDataWrhse.Value = True Then
strConsCorp = "Corporate Data Warehouse" & vbCrLf
ElseIf Me!ConsiderationsCorpDataWrhse.Value = False Then
strConsCorp = ""
End If
If Me!ConsiderationsProviderDir.Value = True Then
strConsProv = "Provider Directory" & vbCrLf
Else
strConsProv = ""
End If
If Me!ConsiderationsSLIQ.Value = True Then
strConsSliq = "SLIQ" & vbCrLf
Else
strConsSliq = ""
End If
If Me!ConsiderationsHIPAA.Value = True Then
strConsHipaa = "HIPAA" & vbCrLf
Else
strConsHipaa = ""
End If
If Me!ConsiderationsECommerce.Value = True Then
strConsEcom = "ECommerce" & vbCrLf
Else
strConsEcom = ""
End If
If Me!ConsiderationsPlanmate.Value = True Then
strConsPlanmate = "Planmate" & vbCrLf
Else
strConsPlanmate = ""
End If
If Me!ConsiderationsOtherChk.Value = True Then
ConsidOther = "OTHER: " & Me!ConsiderationsOther
strConsAll = strConsNone & strConsMHS & strConsOptimed & strConsCorp & strConsProv & strConsSliq & strConsEcom & strConsPlanmate & ConsidOther
ElseIf Me!ConsiderationsOtherChk.Value = False Then
ConsidOther = ""
strConsAll = strConsNone & strConsMHS & strConsOptimed & strConsCorp & strConsProv & strConsSliq & strConsEcom & strConsPlanmate & ConsidOther
End If
.ActiveDocument.Bookmarks("Considerations"
.Select
.Selection.text = (CStr(strConsAll & vbNullString))
'******************Implementation Block *******************************
If Me!ProgramNameChk.Value = True Then
strProgName = "Program: " & Me!ImplChecklistProgramName & vbCrLf
Else
strProgName = ""
End If
If Me!ImplChecklistProjanChk.Value = True Then
strProj = "Program Names Added to Projan" & vbCrLf
Else
strProj = ""
End If
If Me!ImplOtherChk.Value = True Then
ImplOther = "Other: " & Me!ImplChecklistOther & vbCrLf
Else
ImplOther = ""
End If
strImplAll = strProgName & strProj & ImplOther
.ActiveDocument.Bookmarks("Implementation"
.Select
.Selection.text = (CStr(strImplAll & vbNullString))
End With
End If
'End if
Exit_Command137_Click:
Exit Sub
Err_Command137_Click:
MsgBox Err.Description
Resume Exit_Command137_Click
End Sub
I am exporting data from a form in Access to Word using Bookmarks. I am using Access 97 and Word 97. Now the exporting works fine except when the users go back in database and update the same record and try to export the currently updated record, then my code is able to find the file and bring back that file with any changes made in the Word Document (like if the clients have added graphics or anything), but the Problem is:
It concatenates all the new values with the old values on the word document.
For Example :
I have a book mark on hte word document for title, so if the title is:
Problem with Bookmarks
then when I update the same record and change the title to:
Problem With Bookmarks on Word
and try to export the updated version then it brings up the old word file like this:
Title: Problem with BookmarksProblem with Bookmarks on Word
So can anyone please help to solve this problem of concatenating these strings so that the new word document will come up like:
Title: Problem with Bookmarks on Word.
Any help will be really appreciated.
The following is the code that I am using to export the data to word:
Private Sub Command137_Click()
On Error GoTo Err_Command137_Click
Dim objWord As Object
Set objWord = CreateObject("Word.Application"
Dim WordTemplate As String
'WordTemplate = "C:\WINNT\Profiles\c62dr60\desktop\Stemp.dot"
Dim FoundFile As Boolean
'WordTemplate = "G:\RModi\updates\Stemp.dot"
'Functional Area Block
'********************************************************************************
'********************************************************************************
'CHECKING FOR AN EXISTING DOCUMENT
Dim CurWord As String
Dim ProjectNum As String
ProjectNum = Me.ReferenceNumberTxt
CurWord = "G:\RModi\updates\" & ProjectNum & ".doc"
With Application.FileSearch
.LookIn = "G:\RModi\updates\"
'.LookIn = "C:\WINNT\Profiles\c62dr60\desktop\"
.FileName = ProjectNum & ".doc"
If .Execute(SortBy:=msoSortbyFileName, _
SortOrder:=msoSortOrderAscending) > 0 Then
MsgBox "There were " & .FoundFiles.Count & _
" file(s) found."
WordTemplate = "G:\RModi\updates\" & ProjectNum & ".doc"
'WordTemplate = "C:\WINNT\Profiles\c62dr60\desktop\Stemp.dot"
FoundFile = True
Else
'WordTemplate = "C:\WINNT\Profiles\c62dr60\desktop\Stemp.dot"
WordTemplate = "G:\RModi\updates\Stemp.dot"
MsgBox "There were no files found."
FoundFile = False
End If
End With
Dim FunctionalAreaNum As Integer
Dim strFunctional As String
'Testing Considerations Block
Dim TestingNum As Integer
Dim strTestingNone As String
Dim strMHS As String
Dim strQIPS As String
Dim strGeoAccess As String
Dim strCapitation As String
Dim strother As String
Dim strTestingAll As String
'Considerations Block
Dim strConsAll As String
Dim strConsNone As String
Dim strConsMHS As String
Dim strConsHipaa As String
Dim strConsOptimed As String
Dim strConsCorp As String
Dim strConsProv As String
Dim strConsSliq As String
Dim strConsEcom As String
Dim strConsPlanmate As String
Dim ConsidOther As String
Dim DB As Database
Set DB = CurrentDb
Dim Quote As String
Quote = Chr$(34)
'Implementation CheckList Block
Dim strImplAll As String
Dim strProgName As String
Dim strProj As String
Dim ImplOther As String
Dim CreatedBy As Recordset
Set CreatedBy = DB.OpenRecordset("SELECT SOWCreatedByTable.CreatedBy From SOWCreatedByTable Where SOWCreatedByTable.[Project#] = " & Quote & Me.ReferenceNumberTxt & Quote & " AND SOWCreatedByTable.[Version] = " & Me.VersionNumberTxt & ";"
Dim strCreatedBy As String
If FoundFile = True Then
With CreatedBy
Do While Not .EOF
If strCreatedBy = "" Then
strCreatedBy = CreatedBy.Fields(0)
ElseIf strCreatedBy <> "" Then
strCreatedBy = strCreatedBy & vbCrLf & _
CreatedBy.Fields(0)
End If
.MoveNext
Loop
End With
With objWord
.Visible = True
.Documents.Open (WordTemplate)
.ActiveDocument.Bookmarks("RefNumber"
.Selection.text = (CStr(Me.ReferenceNumberTxt & vbNullString))
.ActiveDocument.Bookmarks("Version"
.Selection.text = (CStr(Me.VersionNumberTxt & vbNullString))
.ActiveDocument.Bookmarks("Activity"
.Selection.text = (CStr(Me.Activity & vbNullString))
.ActiveDocument.Bookmarks("Assumptions"
.Selection.text = (CStr(Me.Assumptions & vbNullString))
.ActiveDocument.Bookmarks("CostDescription"
.Selection.text = (CStr(Me.CostDescription & vbNullString))
.ActiveDocument.Bookmarks("CreatedBy"
.Selection.text = (CStr(strCreatedBy & vbNullString))
.ActiveDocument.Bookmarks("CreationDate"
.Selection.text = (CStr(Me.CreateDate & vbNullString))
.ActiveDocument.Bookmarks("EndResearch"
.Selection.text = (CStr(Me.EndResearch & vbNullString))
.ActiveDocument.Bookmarks("ISLead"
.Selection.text = (CStr(Me.ISLeadCmb & vbNullString))
.ActiveDocument.Bookmarks("RequestName"
.Selection.text = (CStr(Me.RequestNameTxt & vbNullString))
.ActiveDocument.Bookmarks("RevisionDate"
.Selection.text = (CStr(Me.RevisionDate & vbNullString))
.ActiveDocument.Bookmarks("Scope"
.Selection.text = (CStr(Me.ScopeTxt & vbNullString))
.ActiveDocument.Bookmarks("ServiceRequestDate"
.Selection.text = (CStr(Me.ServiceRequestDateTxt & vbNullString))
.ActiveDocument.Bookmarks("StartActive"
.Selection.text = (CStr(Me.StartActive & vbNullString))
.ActiveDocument.Bookmarks("StartResearch"
.Selection.text = (CStr(Me.StartResearch & vbNullString))
.ActiveDocument.Bookmarks("SystemComplete"
.Selection.text = (CStr(Me.SystemTestComplete & vbNullString))
FunctionalAreaNum = FunctionalAreaTxt
If FunctionalAreaNum = 1 Then
strFunctional = "Professional Only"
ElseIf FunctionalAreaNum = 2 Then
strFunctional = "Institutional Only"
ElseIf FunctionalAreaNum = 3 Then
strFunctional = "Professional and Institutional"
End If
.ActiveDocument.Bookmarks("FunctionalArea"
.Selection.text = (CStr(strFunctional & vbNullString))
'******************Testing Considerations Block *******************************
If Me!TestingConsNone.Value = True Then
strTestingNone = "None" & vbCrLf
ElseIf Me!TestingConsNone.Value = False Then
strTestingNone = ""
End If
If Me!TestingConsMHS.Value = True Then
strMHS = "MHS" & vbCrLf
ElseIf Me!TestingConsMHS.Value = False Then
strMHS = ""
End If
If Me!TestingConsQIPS.Value = True Then
strQIPS = "QIPS" & vbCrLf
ElseIf Me!TestingConsQIPS.Value = False Then
strQIPS = ""
End If
If Me!TestingConsCapitation.Value = True Then
strCapitation = "Capitation" & vbCrLf
ElseIf Me!TestingConsCapitation.Value = False Then
strCapitation = ""
End If
If Me!TestingConsGEOAccess.Value = True Then
strGeoAccess = "GeoAccess" & vbCrLf
Else
strGeoAccess = ""
End If
If Me!TestingOtherChk.Value = True Then
strother = "OTHER: " & Me!TestingConsiderationsOther
strTestingAll = strTestingNone & strMHS & strQIPS & strCapitation & strGeoAccess & strother
ElseIf Me!TestingOtherChk.Value = False Then
strother = ""
strTestingAll = strTestingNone & strMHS & strQIPS & strCapitation & strGeoAccess
End If
.ActiveDocument.Bookmarks("TestingCons"
.Selection.text = (CStr(strTestingAll & vbNullString))
'******************Considerations Block *******************************
If Me!ConsiderationsNone.Value = True Then
strConsNone = "None" & vbCrLf
ElseIf Me!ConsiderationsNone.Value = False Then
strConsNone = ""
End If
If Me!ConsiderationsMHS.Value = True Then
strConsMHS = "MHS Interface" & vbCrLf
ElseIf Me!ConsiderationsMHS.Value = False Then
strConsMHS = ""
End If
If Me!ConsiderationsOptimed.Value = True Then
strConsOptimed = "Optimed" & vbCrLf
ElseIf Me!ConsiderationsOptimed.Value = False Then
strConsOptimed = ""
End If
If Me!ConsiderationsCorpDataWrhse.Value = True Then
strConsCorp = "Corporate Data Warehouse" & vbCrLf
ElseIf Me!ConsiderationsCorpDataWrhse.Value = False Then
strConsCorp = ""
End If
If Me!ConsiderationsProviderDir.Value = True Then
strConsProv = "Provider Directory" & vbCrLf
Else
strConsProv = ""
End If
If Me!ConsiderationsSLIQ.Value = True Then
strConsSliq = "SLIQ" & vbCrLf
Else
strConsSliq = ""
End If
If Me!ConsiderationsHIPAA.Value = True Then
strConsHipaa = "HIPAA" & vbCrLf
Else
strConsHipaa = ""
End If
If Me!ConsiderationsECommerce.Value = True Then
strConsEcom = "ECommerce" & vbCrLf
Else
strConsEcom = ""
End If
If Me!ConsiderationsPlanmate.Value = True Then
strConsPlanmate = "Planmate" & vbCrLf
Else
strConsPlanmate = ""
End If
If Me!ConsiderationsOtherChk.Value = True Then
ConsidOther = "OTHER: " & Me!ConsiderationsOther
strConsAll = strConsNone & strConsMHS & strConsOptimed & strConsCorp & strConsProv & strConsSliq & strConsEcom & strConsPlanmate & ConsidOther
ElseIf Me!ConsiderationsOtherChk.Value = False Then
ConsidOther = ""
strConsAll = strConsNone & strConsMHS & strConsOptimed & strConsCorp & strConsProv & strConsSliq & strConsEcom & strConsPlanmate & ConsidOther
End If
.ActiveDocument.Bookmarks("Considerations"
.Selection.text = (CStr(strConsAll & vbNullString))
'******************Implementation Block *******************************
If Me!ProgramNameChk.Value = True Then
strProgName = "Program: " & Me!ImplChecklistProgramName & vbCrLf
Else
strProgName = ""
End If
If Me!ImplChecklistProjanChk.Value = True Then
strProj = "Program Names Added to Projan" & vbCrLf
Else
strProj = ""
End If
If Me!ImplOtherChk.Value = True Then
ImplOther = "Other: " & Me!ImplChecklistOther & vbCrLf
Else
ImplOther = ""
End If
strImplAll = strProgName & strProj & ImplOther
.ActiveDocument.Bookmarks("Implementation"
.Selection.text = (CStr(strImplAll & vbNullString))
End With
Else
With CreatedBy
Do While Not .EOF
If strCreatedBy = "" Then
strCreatedBy = CreatedBy.Fields(0)
ElseIf strCreatedBy <> "" Then
strCreatedBy = strCreatedBy & vbCrLf & _
CreatedBy.Fields(0)
End If
.MoveNext
Loop
End With
With objWord
.Visible = True
.Documents.Add (WordTemplate)
.ActiveDocument.Bookmarks("RefNumber"
.Selection.text = (CStr(Me.ReferenceNumberTxt & vbNullString))
.ActiveDocument.Bookmarks("Version"
.Selection.text = (CStr(Me.VersionNumberTxt & vbNullString))
.ActiveDocument.Bookmarks("Activity"
.Selection.text = (CStr(Me.Activity & vbNullString))
.ActiveDocument.Bookmarks("Assumptions"
.Selection.text = (CStr(Me.Assumptions & vbNullString))
.ActiveDocument.Bookmarks("CostDescription"
.Selection.text = (CStr(Me.CostDescription & vbNullString))
.ActiveDocument.Bookmarks("CreatedBy"
.Selection.text = (CStr(strCreatedBy & vbNullString))
.ActiveDocument.Bookmarks("CreationDate"
.Selection.text = (CStr(Me.CreateDate & vbNullString))
.ActiveDocument.Bookmarks("EndResearch"
.Selection.text = (CStr(Me.EndResearch & vbNullString))
.ActiveDocument.Bookmarks("ISLead"
.Selection.text = (CStr(Me.ISLeadCmb & vbNullString))
.ActiveDocument.Bookmarks("RequestName"
.Selection.text = (CStr(Me.RequestNameTxt & vbNullString))
.ActiveDocument.Bookmarks("RevisionDate"
.Selection.text = (CStr(Me.RevisionDate & vbNullString))
.ActiveDocument.Bookmarks("Scope"
.Selection.text = (CStr(Me.ScopeTxt & vbNullString))
.ActiveDocument.Bookmarks("ServiceRequestDate"
.Selection.text = (CStr(Me.ServiceRequestDateTxt & vbNullString))
.ActiveDocument.Bookmarks("StartActive"
.Selection.text = (CStr(Me.StartActive & vbNullString))
.ActiveDocument.Bookmarks("StartResearch"
.Selection.text = (CStr(Me.StartResearch & vbNullString))
.ActiveDocument.Bookmarks("SystemComplete"
.Selection.text = (CStr(Me.SystemTestComplete & vbNullString))
FunctionalAreaNum = FunctionalAreaTxt
If FunctionalAreaNum = 1 Then
strFunctional = "Professional Only"
ElseIf FunctionalAreaNum = 2 Then
strFunctional = "Institutional Only"
ElseIf FunctionalAreaNum = 3 Then
strFunctional = "Professional and Institutional"
End If
.ActiveDocument.Bookmarks("FunctionalArea"
.Selection.text = (CStr(strFunctional & vbNullString))
'******************Testing Considerations Block *******************************
If Me!TestingConsNone.Value = True Then
strTestingNone = "None" & vbCrLf
ElseIf Me!TestingConsNone.Value = False Then
strTestingNone = ""
End If
If Me!TestingConsMHS.Value = True Then
strMHS = "MHS" & vbCrLf
ElseIf Me!TestingConsMHS.Value = False Then
strMHS = ""
End If
If Me!TestingConsQIPS.Value = True Then
strQIPS = "QIPS" & vbCrLf
ElseIf Me!TestingConsQIPS.Value = False Then
strQIPS = ""
End If
If Me!TestingConsCapitation.Value = True Then
strCapitation = "Capitation" & vbCrLf
ElseIf Me!TestingConsCapitation.Value = False Then
strCapitation = ""
End If
If Me!TestingConsGEOAccess.Value = True Then
strGeoAccess = "GeoAccess" & vbCrLf
Else
strGeoAccess = ""
End If
If Me!TestingOtherChk.Value = True Then
strother = "OTHER: " & Me!TestingConsiderationsOther
strTestingAll = strTestingNone & strMHS & strQIPS & strCapitation & strGeoAccess & strother
ElseIf Me!TestingOtherChk.Value = False Then
strother = ""
strTestingAll = strTestingNone & strMHS & strQIPS & strCapitation & strGeoAccess
End If
.ActiveDocument.Bookmarks("TestingCons"
.Selection.text = (CStr(strTestingAll & vbNullString))
'******************Considerations Block *******************************
If Me!ConsiderationsNone.Value = True Then
strConsNone = "None" & vbCrLf
ElseIf Me!ConsiderationsNone.Value = False Then
strConsNone = ""
End If
If Me!ConsiderationsMHS.Value = True Then
strConsMHS = "MHS Interface" & vbCrLf
ElseIf Me!ConsiderationsMHS.Value = False Then
strConsMHS = ""
End If
If Me!ConsiderationsOptimed.Value = True Then
strConsOptimed = "Optimed" & vbCrLf
ElseIf Me!ConsiderationsOptimed.Value = False Then
strConsOptimed = ""
End If
If Me!ConsiderationsCorpDataWrhse.Value = True Then
strConsCorp = "Corporate Data Warehouse" & vbCrLf
ElseIf Me!ConsiderationsCorpDataWrhse.Value = False Then
strConsCorp = ""
End If
If Me!ConsiderationsProviderDir.Value = True Then
strConsProv = "Provider Directory" & vbCrLf
Else
strConsProv = ""
End If
If Me!ConsiderationsSLIQ.Value = True Then
strConsSliq = "SLIQ" & vbCrLf
Else
strConsSliq = ""
End If
If Me!ConsiderationsHIPAA.Value = True Then
strConsHipaa = "HIPAA" & vbCrLf
Else
strConsHipaa = ""
End If
If Me!ConsiderationsECommerce.Value = True Then
strConsEcom = "ECommerce" & vbCrLf
Else
strConsEcom = ""
End If
If Me!ConsiderationsPlanmate.Value = True Then
strConsPlanmate = "Planmate" & vbCrLf
Else
strConsPlanmate = ""
End If
If Me!ConsiderationsOtherChk.Value = True Then
ConsidOther = "OTHER: " & Me!ConsiderationsOther
strConsAll = strConsNone & strConsMHS & strConsOptimed & strConsCorp & strConsProv & strConsSliq & strConsEcom & strConsPlanmate & ConsidOther
ElseIf Me!ConsiderationsOtherChk.Value = False Then
ConsidOther = ""
strConsAll = strConsNone & strConsMHS & strConsOptimed & strConsCorp & strConsProv & strConsSliq & strConsEcom & strConsPlanmate & ConsidOther
End If
.ActiveDocument.Bookmarks("Considerations"
.Selection.text = (CStr(strConsAll & vbNullString))
'******************Implementation Block *******************************
If Me!ProgramNameChk.Value = True Then
strProgName = "Program: " & Me!ImplChecklistProgramName & vbCrLf
Else
strProgName = ""
End If
If Me!ImplChecklistProjanChk.Value = True Then
strProj = "Program Names Added to Projan" & vbCrLf
Else
strProj = ""
End If
If Me!ImplOtherChk.Value = True Then
ImplOther = "Other: " & Me!ImplChecklistOther & vbCrLf
Else
ImplOther = ""
End If
strImplAll = strProgName & strProj & ImplOther
.ActiveDocument.Bookmarks("Implementation"
.Selection.text = (CStr(strImplAll & vbNullString))
End With
End If
'End if
Exit_Command137_Click:
Exit Sub
Err_Command137_Click:
MsgBox Err.Description
Resume Exit_Command137_Click
End Sub