part 5
Sub newtemplatecheck()
Set WDApp = GetObject(, "Word.Application")
WDApp.Visible = True
Set WDDoc = WDApp.ActiveDocument
sheetname = ActiveSheet.Name
Application.ScreenUpdating = False
actioncount = 0
If WDDoc.FormFields("NoRetinopathyRE").CheckBox.Value = False And WDDoc.FormFields("MinimalRE").CheckBox.Value = False And _
WDDoc.FormFields("MildRE").CheckBox.Value = False And WDDoc.FormFields("ModerateRE").CheckBox.Value = False And _
WDDoc.FormFields("SevereRE").CheckBox.Value = False And WDDoc.FormFields("ProliferativeRE").CheckBox.Value = False And _
WDDoc.FormFields("MacularEdemaRE").CheckBox.Value = False And WDDoc.FormFields("PStableRE").CheckBox.Value = False And _
WDDoc.FormFields("PActiveRE").CheckBox.Value = False Then
If WDDoc.FormFields("NoRetinopathyLE").CheckBox.Value = False And WDDoc.FormFields("MinimalLE").CheckBox.Value = False And _
WDDoc.FormFields("MildLE").CheckBox.Value = False And WDDoc.FormFields("ModerateLE").CheckBox.Value = False And _
WDDoc.FormFields("SevereLE").CheckBox.Value = False And WDDoc.FormFields("ProliferativeLE").CheckBox.Value = False And _
WDDoc.FormFields("MacularEdemaLE").CheckBox.Value = False And WDDoc.FormFields("PStableLE").CheckBox.Value = False And _
WDDoc.FormFields("PActiveLE").CheckBox.Value = False Then
If WDDoc.FormFields("GlacomaSuspectRE").CheckBox.Value = False And WDDoc.FormFields("GlacomaSuspectLE").CheckBox.Value = False Then
If WDDoc.FormFields("AMD_RE").CheckBox.Value = False And WDDoc.FormFields("AMD_LE").CheckBox.Value = False Then
If WDDoc.FormFields("CataractRE").CheckBox.Value = False And WDDoc.FormFields("CataractLE").CheckBox.Value = False Then
If WDDoc.FormFields("UngradableRE").CheckBox.Value = False And WDDoc.FormFields("UngradableLE").CheckBox.Value = False Then
If WDDoc.FormFields("Others").Result = "N.A." And WDDoc.FormFields("OthersRE").CheckBox.Value = False And _
WDDoc.FormFields("OthersLE").CheckBox.Value = False Then
If WDDoc.FormFields("MainFinding").Result = "Please Select" And WDDoc.FormFields("Comments").Result = "" And _
WDDoc.FormFields("ReScreen6Months").CheckBox.Value = False Then
If WDDoc.FormFields("Immediate").CheckBox.Value = False And WDDoc.FormFields("Week1").CheckBox.Value = False And _
WDDoc.FormFields("Month1").CheckBox.Value = False And WDDoc.FormFields("Months3").CheckBox.Value = False And _
WDDoc.FormFields("Months6").CheckBox.Value = False Then
actioncount = actioncount + 1
End If
End If
End If
End If
End If
End If
End If
End If
End If
If actioncount > 0 Then
actionstop = "stop"
MsgBox "The form has not been edited!!!", vbExclamation, "Form validation"
Exit Sub
End If
actioncount = 0
If WDDoc.FormFields("Immediate").CheckBox.Value = True Then actioncount = actioncount + 1
If WDDoc.FormFields("Week1").CheckBox.Value = True Then actioncount = actioncount + 1
If WDDoc.FormFields("Week2").CheckBox.Value = True Then actioncount = actioncount + 1
If WDDoc.FormFields("Months1").CheckBox.Value = True Then actioncount = actioncount + 1
If WDDoc.FormFields("Months3").CheckBox.Value = True Then actioncount = actioncount + 1
If actioncount > 1 Then
actionstop = "stop"
MsgBox "Please check the Referral column, More than 1 referral checked!!!", vbExclamation, "Form validation"
Exit Sub
End If
'main diagnosis
If WDDoc.FormFields("MainFinding").Result = "Please Select" Then
actionstop = "stop"
MsgBox "Please check the Main Diagnosis, it is not selected!!!", vbExclamation, "Form validation"
Exit Sub
End If
'Others validation
If WDDoc.FormFields("Others").Result <> "N.A" Then
If WDDoc.FormFields("OthersRE").CheckBox.Value = False And WDDoc.FormFields("OthersLE").CheckBox.Value = False Then
actionstop = "stop"
MsgBox "Please check the Others Ocular finding, it is not selected!!!", vbExclamation, "Form validation"
Exit Sub
End If
End If
'########################## SET TIME ####################################
'MsgBox Application.Text(timeDifference, "[hh]:mm")
'Cells(i, 7).NumberFormat = "[hh]:mm"
Bookmarks