J
Jay Freedman
See http://word.mvps.org/FAQs/TblsFldsFms/ValidateFFields.htm for the
general idea.
To make sure the user can't exit a field without entering something in it,
use the code in the article but change the line
If Len(.Result) > 0 And Left$(.Result, 3) <> "KLM" Then
to
If Len(.Result) = 0 Then
You'll also have to change the field name ("Test2" in the example) to the
correct name wherever it appears in the macro, and change the message that's
displayed by the MsgBox statement.
Each mandatory field needs its own exit macro because the field's name is
explicitly written into the code. If you have a lot of mandatory fields, it
may be possible to revise the code so the same macro functions for all of
them.
--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
general idea.
To make sure the user can't exit a field without entering something in it,
use the code in the article but change the line
If Len(.Result) > 0 And Left$(.Result, 3) <> "KLM" Then
to
If Len(.Result) = 0 Then
You'll also have to change the field name ("Test2" in the example) to the
correct name wherever it appears in the macro, and change the message that's
displayed by the MsgBox statement.
Each mandatory field needs its own exit macro because the field's name is
explicitly written into the code. If you have a lot of mandatory fields, it
may be possible to revise the code so the same macro functions for all of
them.
--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.