Word - Multiple Required Fields

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Mr. Manley

Thread Starter
Joined
Jan 26, 2009
Messages
3
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
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Staff online

Members online

Top