FormField Data Vetting - How to Re-select an invalid field?

R

RPJ

I am attempting to use Macros to test data selected (Dropdown) or entered
(Text) into a protected Word 2003 form.

Thanks to some support from this forum I can now readilly identify (by
Bookmark name or Item number) the formfield that calls a data vetting Macro
on Exit.

But there's another snag:

Once I have determined the identity of the formfield and proven that the
data it holds is invalid I should like to re-select the field and put an
appropriate Error Message in the Status Bar. - But I don't seem able to
return to the formfield that called the data vetting Macro.

Can anyone please offer some good advice?

Paul J
 
P

Paul J

The macro code presently being used for data vetting is as follows:

Sub ValidateSalesRegNo()
With ActiveDocument
If .FormFields(Selection.BookmarkID).Result = " " Then
..FormFields(Selection.BookmarkID).Select
StatusBar = "**** INVALID SALES REGION NUMBER *****"
End If
End With
End Sub

This macro works perfectly well when you step (F8) through it UNTIL the End
Sub instruction occurs and then the focus of the form suddenly moves forward
to the next formfield on the form and the status bar message is lost
(obliterated by the status bar help text of the next formfield).

Can anyone help, please?

Paul J
 
Top