Formfield requires input

P

Peter

I have a form with a text field that requires input. I assigned the following
macro to the ExitMacro property:

Public Sub Text1_Exit()
With ActiveDocument.FormFields("Text1")
If .Result = "" Then
MsgBox "You must enter a value.", vbCritical + vbOKOnly
.Select
End If
End With
End Sub

If I tab through this field, I get the expected message box but, the cursor
moves to the next field anyway. I want the Text1 field to be reselected and
the user not allowed to move to the next field until they have made an entry.
What am I doing wrong?

Thanks,
Peter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top