I am working in Word 2002. I have a check box (check1), that if checked the
user must complete text1.
I would like to have an OnExit macro, so when the user tabs out of text1,
and check1 is checked, a message will appear stating "You must complete this
field."
I'm not sure how to go about doing this, any help is appreciated.
Thanks,
>I am working in Word 2002. I have a check box (check1), that if checked the
>user must complete text1.
[quoted text clipped - 6 lines]
>
>Thanks,
The basic idea is explained at
http://www.word.mvps.org/FAQs/TblsFldsFms/ValidateFFields.htm. The
specific test in the example macro won't do, of course. The code you
need looks something like this:
Sub ExitText1()
With ActiveDocument.FormFields("Text1")
If Len(.Result) = 0 And _
ActiveDocument.FormFields("Check1") _
.CheckBox.Value = True Then
Application.OnTime _
When:=Now + TimeValue("00:00:01"), _
Name:="GoBacktoText1"
MsgBox "You must complete this field"
End If
End With
End Sub
Sub GoBacktoText1()
ActiveDocument.Bookmarks("Text1").Range _
.Fields(1).Result.Select
End Sub
--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Jamie - 09 Sep 2005 22:25 GMT
Hi Jay, thanks for the coding, it's working great!!

Signature
Jamie
> >I am working in Word 2002. I have a check box (check1), that if checked the
> >user must complete text1.
[quoted text clipped - 34 lines]
> Jay Freedman
> Microsoft Word MVP FAQ: http://word.mvps.org