• Quick Code question for word form (Word 2000)

    Home » Forums » AskWoody support » Productivity software by function » MS Word and word processing help » Quick Code question for word form (Word 2000)

    Author
    Topic
    #412902

    Post deleted by NYIntensity

    Viewing 1 reply thread
    Author
    Replies
    • #906902

      By “form” do you mean a Word document with form fields (from the Forms toolbar), or a VBA UserForm?

      • #906906

        Post deleted by NYIntensity

        • #906934

          Forms with form fields can be difficult to control. You can create a macro that warns the user and set it as Exit macro for the text field and for the check box, but this will not force the user to fill in the text box.

          Sub TestAndWarn()
          If ActiveDocument.FormFields(“Check1”).CheckBox.Value = True And _
          ActiveDocument.FormFields(“Text1”).Result = “” Then
          MsgBox “Fill in the text box”
          ActiveDocument.Bookmarks(“Text1”).Range.Fields(1).Result.Select
          End If
          End Sub

          This will not even reselect the text box if you tab out of it.

        • #906935

          Forms with form fields can be difficult to control. You can create a macro that warns the user and set it as Exit macro for the text field and for the check box, but this will not force the user to fill in the text box.

          Sub TestAndWarn()
          If ActiveDocument.FormFields(“Check1”).CheckBox.Value = True And _
          ActiveDocument.FormFields(“Text1”).Result = “” Then
          MsgBox “Fill in the text box”
          ActiveDocument.Bookmarks(“Text1”).Range.Fields(1).Result.Select
          End If
          End Sub

          This will not even reselect the text box if you tab out of it.

      • #906907

        Post deleted by NYIntensity

    • #906903

      By “form” do you mean a Word document with form fields (from the Forms toolbar), or a VBA UserForm?

    Viewing 1 reply thread
    Reply To: Quick Code question for word form (Word 2000)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: