Results 1 to 4 of 4
  1. #1
    2 Star Lounger
    Join Date
    Oct 2007
    Posts
    172
    Thanks
    0
    Thanked 2 Times in 1 Post

    Form with multiple pages (MS Word 2003)

    Ahh hello Hans, since you're obviously online, i'll ask another one ;-)

    I want to create a form which has several pages, so that when you complete one you can press "Next >" or "< Back" to go to the next or previous page respectively. Like a wizard. I don't want to use tabs because i want to lead the user through some steps.

    How is it best to do this? I was thinking I could have several frames on a single form where only one of them is visible at a time.. when you press next it simply makes the next one visible. However this causes problems in the design view, if not when the form is running. In the design view you can't make things invisible and it'll be a right mess.

    I can't seem to embed a form in another form (or can I?) and I'd rather do it on one form, because i need to store some values from the form in the spreadsheet and i'd like to do this in a loop - using multiple forms would complicate this.

    cheers!

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

    Re: Form with multiple pages (MS Word 2003)

    I'd use a multipage control with the Style property set to 2 - fmTabStyleNone. This means that there will be no visible "tabs", but you can still switch from one "page" to another using code, for example in the On Click code of a "Next" or "Back" command button. The advantage is that VBA takes care of displaying only the controls on the active "page".

    The code for a "Next" and Previous" button could look like this:
    <code>
    Private Sub cmdNext_Click()
    With Me.mpgTabs
    If .Value < .Pages.Count - 1 Then
    .Value = .Value + 1
    End If
    End With
    End Sub

    Private Sub cmdPrevious_Click()
    With Me.mpgTabs
    If .Value > 0 Then
    .Value = .Value - 1
    End If
    End With
    End Sub
    </code>
    You can add bells and whistles, of course.

    Obviously, not seeing the "tabs" is a problem in the design phase, so I'd leave the Type property set to 0 - fmTabStyleTabs until the design is finished, then set it to 2 - fmTabStyleNone at the last moment.

  3. #3
    2 Star Lounger
    Join Date
    Oct 2007
    Posts
    172
    Thanks
    0
    Thanked 2 Times in 1 Post

    Re: Form with multiple pages (MS Word 2003)

    ah genius.

    do you have a day job? :-)

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

    Re: Form with multiple pages (MS Word 2003)

    Yes, I do (but it's not a full time job).

Posting Permissions

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