Results 1 to 5 of 5
  1. #1
    Silver Lounger
    Join Date
    Mar 2001
    Location
    Dallas, Texas, USA
    Posts
    1,680
    Thanks
    0
    Thanked 1 Time in 1 Post

    Multi-page userform

    Trial and Error would work but I hate the "error" part!

    I am adding functionality to a 7-tab userform. At the bottom edge, there are five buttons: Reset, Cancel, Back, Next and Finished. The 1st tab does not have the "back" and the last tab does not have the "next" buttons.

    Will the code attached to either of the buttons effect the entire userform or just the visible page (tab)? And secondly, what code would you attach to the [Next] button to change the view to the next tab?
    - Ricky

  2. #2
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Dublin, Ireland, Republic of
    Posts
    2,697
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Multi-page userform

    Ricky,

    You need to distinguish between a MultiPage control and a TabStrip. As you indicate that you have different buttons on different tabs, it must be a MultiPage control. If your pages do need to be completed in a certain order, then perhaps you should abandon the MultiPage approach and use consecutive userforms, loaded as the previous forms are completed. However if the order of data entrty is not important, why bother with Next and Previous buttons ?. The user can navigate by using the tabs, as that is what they are for.

    Any control buttons that you place on different pages, are different buttons and each would need their own code to function. You should consider placing the control buttons on the userform but outside the multipage control (probably underneath), so that there is only one Cancel button and one Finish button etc (visible regardless of the active MultiPage element). That way you just need to code the single Finish button to process any data collected by any or all of the pages.

    So unless the order of the pages is important, I would abandon the Prev and Next buttons. If order is important then I would abandon the MultiPage control.

    Hope that can assist you

    Andrew

  3. #3
    Silver Lounger
    Join Date
    Mar 2001
    Location
    Dallas, Texas, USA
    Posts
    1,680
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Multi-page userform

    That helps alot. Thanks for the cleat and precise instruction. I am making the necessary changes now.
    - Ricky

  4. #4
    Platinum Lounger
    Join Date
    Dec 2000
    Location
    Queanbeyan, New South Wales, Australia
    Posts
    3,730
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Multi-page userform

    Ricky,

    You would have to have something attached to the "Click" event of the tab. If the tab index is zero (Multipage1.SelectedItem.Index), disable the "Prev" button; if 4, disable "next"; otherwise, enable both.

    You can set the same property to change the tab:
    sub cmdnext_click()
    Multipage1.SelectedItem.Index = Multipage1.SelectedItem.Index + 1
    end sub

    I assume you've used a multipage control rather than a tabstrip form the subject. There are differences- check in the online help for a quick view.

    There's info <A target="_blank" HREF=http://support.microsoft.com/support/kb/articles/Q155/3/74.asp>here</A> on using multipage controls.
    Subway Belconnen- home of the Signboard to make you smile. Get (almost) daily updates- follow SubwayBelconnen on Twitter.

  5. #5
    Silver Lounger
    Join Date
    Mar 2001
    Location
    Dallas, Texas, USA
    Posts
    1,680
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Multi-page userform

    Hey Geoff:

    Thanks for the response - I see how it works now. I followed the link you provided and it does provide more info than the system help files.
    - Ricky

Posting Permissions

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