Try this
Sub CombineBM()
Dim Adoc As Document
Dim BMRng As Range
Set Adoc = ActiveDocument
Set BMRng = Adoc.Bookmarks("BM1").Range
If Len(BMRng.Text) = 0 Then
BMRng = Adoc.Bookmarks("BM2") & Adoc.Bookmarks("BM3")
Adoc.Bookmarks.Add "BM1", BMRng 'Encloses text with BM1
End If
End Sub
You can probably combine the two bookmarks at the point where it's
written to Access. Show us the code at that point for further
suggestions.
I should have mentioned the bookmarks are in a protected document.
The command button is password protected.
Thanks for the help
Ron
Here is the code:
Private Sub cmdSendFieldInitiated_Click()
Dim DocName As String
Dim LinkCriteria As String
Dim AuthCode As String
Dim Response As String
Dim Response2 As String
Response = MsgBox("Enter Password", vbOKCancel, "Authorization
Needed")
If Response = vbOK Then
AuthCode = InputBox("Enter Password", "Password")
If AuthCode = "Password" Then
GoTo Line1
Else
Response2 = MsgBox("That is not a valid authorization code.",
vbOKOnly, "Invalid Authorization Code")
End If
Exit_cmdSendToDataBase_Click:
Exit Sub
Err_cmdSendToDataBase_Click:
MsgBox Err.Description
Resume Exit_cmdSendToDataBase_Click
Line1:
Dim strfldEventNum As Long '(Bookmark1)
Dim strfldEventDate As Date
Dim strfldReqDate As Date
Dim strfldApp1 As String '(Bookmark2)
Dim strfldApp1Shift As String '(Bookmark3)
Set ThisDoc = ActiveDocument
fldEventNum = ThisDoc.FormFields("fldEventNum").Result
fldApp1 = ThisDoc.FormFields("fldApp1").Result
fldApp1Shift = ThisDoc.FormFields("fldApp1Shift").Result
Set wrkJet = CreateWorkspace("", "admin", "", dbUseJet)
Set MyDb = wrkJet.OpenDatabase("I:\OFDPubEd\OFD_214")
Set MyTbl = MyDb.OpenRecordset("OFD214FieldInitiated")
With MyTbl
.AddNew
If fldEventNum <> "" Then
!EventNum = fldEventNum
End If
!App1 = fldApp1
If fldApp1Shift <> "" Then
!App1Shift = fldApp1Shift
End If
.Update
End With
Set MyTbl = Nothing
Set MyDb = Nothing
Set wrkJet = Nothing
End Sub