Results 1 to 8 of 8
  1. #1
    New Lounger
    Join Date
    Jul 2002
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts

    MultiPage.Value (Word 2002)

    I have a user form that includes code like this:

    Private Sub MultiPage1_Change()
    If MultiPage1.Value = 1 Then
    If UserForm1.txtRequired.value="" then
    MsgBox "All fields are required ."
    UserForm1.MultiPage1.Value = 0
    End If
    End If
    End Sub

    What I'm trying to do is send the user back to page 1 (value=0) if required info is omitted when page 2 (value=1) is accessed. The problem is that while page 1 receives the focus, all the controls on page 2 remain displayed as if they were part of page 1. Any thoughts?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: MultiPage.Value (Word 2002)

    Does it help if you remove <code>UserForm1.</code> from before txtRequired and MultiPage1?

  3. #3
    New Lounger
    Join Date
    Jul 2002
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: MultiPage.Value (Word 2002)

    No, Hans. I get the same result.

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: MultiPage.Value (Word 2002)

    Are you sure that the problem controls are actually part of page 2 of the multipage control, and not just placed on top of it?

  5. #5
    New Lounger
    Join Date
    Jul 2002
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: MultiPage.Value (Word 2002)

    I'm not sure what you mean by that. I've attached a representative doc for your examination.
    Attached Files Attached Files

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: MultiPage.Value (Word 2002)

    OK, I see the problem. I think it occurs because you change the value of the multipage control in its On Change event - this causes confusion. Try using the On Click event instead:

    Private Sub MultiPage1_Click(ByVal Index As Long)
    If Index = 1 Then
    If Me.txtRequired.Value = "" Then
    MsgBox "All fields are required."
    Me.MultiPage1.Value = 0
    End If
    End If
    End Sub

  7. #7
    New Lounger
    Join Date
    Jul 2002
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: MultiPage.Value (Word 2002)

    That'll work.

    Thanks for this and all the help you have offered in the past. May 2008 be your best.

  8. #8
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: MultiPage.Value (Word 2002)

    Thanks, and best wishes for 2008 for you 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
  •