Based on this formula, how would I change it to validate 2 or more fields simultaneously? More specifically, [If "this field" equals "yes" and the "next field" equals "", then MsgBox...] *Correct for verifying "This field" only:* If...
Based on this formula, how would I change it to validate 2 or more fields simultaneously? More specifically, [If "this field" equals "yes" and the "next field" equals "", then MsgBox...]
Correct for verifying "This field" only:
If Trim(fld.Result) = "" Then
MsgBox "You must complete " & fld.Range.Bookmarks(1).Name & " before you can print.", vbOKOnly + vbExclamation, "Error"
Cancel = True
fld.Select
Exit Sub
End If
My attempt at verifying the "next field":
If Trim(fld.Result) = "Yes" And fld.Next = "" Then
MsgBox "You selected 'Yes' for " & fld.Range.Bookmarks(1).Name & ". Please answer Question 'b' after " & fld.Range.Bookmarks(1).Name & " before printing.", vbOKOnly + vbExclamation, "Error"
Cancel = True
fld.Select
Exit Sub
End If