C
Charlie Brown
In Word 2003, I have created an evaluation form which has several separate
tables for each area being evaluated. The score of each area is entered into
a form field. There are 13 fields, each having its own bookmark name; score1,
score2, score3, etc. The user is to enter a score between 1 and 3 or leave it
blank.
To validate the fields are blank or not greater than 3, I have written this
code;
If ActiveDocument.FormFields("score1").Result > 3 Then
MsgBox "The score must be between 0 and 3.", vbCritical, "Score Check"
ActiveDocument.Bookmarks("score1").Range.Fields(1).Result.Select
End If
It has two problems;
1. It gets a type mismatch error if the field is blank. I am having trouble
figuring out how to checking for NULL fields.
2. Rather than repeat the code 13 times, I would like the code to loop
through all the score fields.
Any help on this would be greatly appreciated.
tables for each area being evaluated. The score of each area is entered into
a form field. There are 13 fields, each having its own bookmark name; score1,
score2, score3, etc. The user is to enter a score between 1 and 3 or leave it
blank.
To validate the fields are blank or not greater than 3, I have written this
code;
If ActiveDocument.FormFields("score1").Result > 3 Then
MsgBox "The score must be between 0 and 3.", vbCritical, "Score Check"
ActiveDocument.Bookmarks("score1").Range.Fields(1).Result.Select
End If
It has two problems;
1. It gets a type mismatch error if the field is blank. I am having trouble
figuring out how to checking for NULL fields.
2. Rather than repeat the code 13 times, I would like the code to loop
through all the score fields.
Any help on this would be greatly appreciated.