Results 1 to 2 of 2
  1. #1
    Star Lounger
    Join Date
    Oct 2002
    New Salem, North Dakota, USA
    Thanked 0 Times in 0 Posts

    Form field help in Word (2003)

    We have a document with a number of text and checkbox form fields, some of which need are required to have information. Is there a way in Word to make sure that they need to populate these fields without just leaving them blank. I would like to check the value when they move to the next field, if it is blank a message box should pop up telling them that a null value is not acceptable.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Thanked 31 Times in 31 Posts

    Re: Form field help in Word (2003)

    Say that you want to require the form field whose bookmark name is FirstName to be filled in.
    Create the following macro in a standard module:

    Sub CheckFirstName()
    If ActiveDocument.FormFields("FirstName").Result = "" Then
    MsgBox "Please enter your first name!", vbCritical
    ActiveDocument.Bookmarks("FirstName").Range.Fields (1).Result.Select
    End If
    End Sub

    While the document is unprotected, double click the form field that comes after the FirstName one.
    Select CheckFirstName in the (Run macro on) Entry dropdown.
    Click OK.

    The user will still be able to click in other form field than the one after it. If you want to prevent that, you'll have to set the macro for those too.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts