Thank you Andrew,
Please excuse my lack of knowledge.
I fixed the field tags but when I pasted the code below the existing code, I get the error message (see the attachment).
And just for the record, the the first code was from another post that I created.
this is the code
Code:
Option Explicit
Private Sub Document_ContentControlOnExit(ByVal CCtrl As ContentControl, Cancel As Boolean)
Application.ScreenUpdating = False
Dim Dt As Date, StrDt As String
With CCtrl
If .Title <> "Date of Initiation" Then Exit Sub
If .ShowingPlaceholderText = True Then
ActiveDocument.SelectContentControlsByTitle("Due Date")(1).Range.Text = ""
Else
StrDt = .Range.Text
If IsDate(StrDt) Then
Dt = CDate(StrDt)
Else
Dt = CDate(Split(StrDt, (Split(StrDt, " ")(0)))(1))
End If
ActiveDocument.SelectContentControlsByTitle("Due Date")(1).Range.Text = Format(Dt + 30, .DateDisplayFormat)
End If
End With
Application.ScreenUpdating = True
End Sub
Private Sub Document_ContentControlOnExit(ByVal ContentControl As ContentControl, Cancel As Boolean)
Select Case ContentControl.Tag
Case "Rev. #"
If ContentControl.ShowingPlaceholderText Then
MsgBox "Rev. # requires a numeric response.", vbInformation + vbOKOnly, "INPUT REQUIRED"
Cancel = True
End If
Case "PDR #"
If ContentControl.ShowingPlaceholderText Then
MsgBox "PDR # requires a numeric response.", vbInformation + vbOKOnly, "INPUT REQUIRED"
Cancel = True
End If
Case "Date of Discovery"
If ContentControl.ShowingPlaceholderText Then
MsgBox "Date of Discovery requires a numeric response.", vbInformation + vbOKOnly, "INPUT REQUIRED"
Cancel = True
End If
Case "Type"
If ContentControl.ShowingPlaceholderText Then
MsgBox "Type requires a numeric response.", vbInformation + vbOKOnly, "INPUT REQUIRED"
Cancel = True
End If
Case "ManNum"
If Not IsNumeric(ContentControl.Range.Text) Then
MsgBox "This field requires a numeric response.", vbInformation + vbOKOnly, "INPUT REQUIRED"
Cancel = True
End If
End Select
lbl_Exit:
Exit Sub
End Sub
I attached the form just in case.