+ Reply to Thread
Results 1 to 6 of 6

Select specific MultiPage in a UserForm with other pages grayed out

  1. #1
    Forum Contributor onmyway's Avatar
    Join Date
    09-03-2012
    Location
    Johannesburg, South Africa
    MS-Off Ver
    2013
    Posts
    386

    Select specific MultiPage in a UserForm with other pages grayed out

    Hi All,

    I am sure you guys would be able to help me.

    I have a UserForm with multiple pages. I have tried different code settings, but cannot seem to get my page 1 to display when the UserForm is launched, with ALL other pages grayed out until the next button is clicked.

    Here is my code, and thanks in advance!:


    Private Sub UserForm2_Initialize()

    Dim i As Integer
    i = Me.MultiPage1.Value

    MultiPage1.Pages(0).Caption = "Personal Detail"
    MultiPage1.Pages(1).Caption = "Examinations1"
    MultiPage1.Pages(2).Caption = "Examinations1"
    MultiPage1.Pages(3).Caption = "Closing"

    MultiPage1.Pages(0).Enabled = True
    MultiPage1.Pages(1).Enabled = False
    MultiPage1.Pages(2).Enabled = False
    MultiPage1.Pages(3).Enabled = False

    MultiPage1.Value = 0

    End Sub

  2. #2
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Select specific MultiPage in a UserForm with other pages grayed out

    hi onmyway, welcome to ExcelForum, please check attachment, press button to show userform
    Attached Files Attached Files

  3. #3
    Forum Contributor onmyway's Avatar
    Join Date
    09-03-2012
    Location
    Johannesburg, South Africa
    MS-Off Ver
    2013
    Posts
    386

    Re: Select specific MultiPage in a UserForm with other pages grayed out

    Hi watersev. Thanks for the response! I tried making some changes as to your example, but cant seem to get it working! I think my issue lies with my other Multipage control.

    Herewith the code and thanks for the help!:
    'Multi Page Controls

    Private Sub UserForm2_Initialize()

    'set properties of each Page of the MultiPage control

    Dim i As Integer
    i = Me.MultiPage1.Value

    'set Caption for each Page:
    MultiPage1.Pages(0).Caption = "Personal Detail"
    MultiPage1.Pages(1).Caption = "Examinations1"
    MultiPage1.Pages(2).Caption = "Examinations1"
    MultiPage1.Pages(3).Caption = "Closing"

    MultiPage1.Pages(0).Enabled = True
    MultiPage1.Pages(1).Enabled = False
    MultiPage1.Pages(2).Enabled = False
    MultiPage1.Pages(3).Enabled = False

    'select first page:
    MultiPage1.Value = 0

    End Sub

    Private Sub MultiPage1_Change()

    'set properties of Previous, Next, Cancel & Save Buttons. Note: these buttons are created outside the MultiPage control.
    Select Case MultiPage1.Value

    'First Page:
    Case 0
    btnPrevious.Enabled = False
    btnNext.Enabled = True
    btnSave.Enabled = False
    btnClose.Enabled = True

    'Last Page:
    Case MultiPage1.Pages.Count - 1
    btnPrevious.Enabled = True
    btnNext.Enabled = False
    btnSave.Enabled = True
    btnClose.Enabled = True

    'Other Pages:
    Case Else
    btnPrevious.Enabled = True
    btnNext.Enabled = True
    btnSave.Enabled = False
    btnClose.Enabled = True

    End Select

    End Sub

  4. #4
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Select specific MultiPage in a UserForm with other pages grayed out

    I'm not sure I understand what is the problem but may be you'll find this helpful

    PS. As a gesture of respect to the people trying to keep this place in order could you please use code tags while posting any VB code? It looks # on post toolbar or check Forum Rules for details.
    Attached Files Attached Files

  5. #5
    Forum Contributor onmyway's Avatar
    Join Date
    09-03-2012
    Location
    Johannesburg, South Africa
    MS-Off Ver
    2013
    Posts
    386

    Re: Select specific MultiPage in a UserForm with other pages grayed out

    Hi there watersev. My apologies about the code, didn't see the code tag.

    I have attached my sample. Would appreciate if you could have a look!

    I would like the following:

    • My UserForm to focus on Page 1 with every new record captured,
    • All the other tabs / pages grayed out unless that is the active page.

    Appreciate it a lot!
    Attached Files Attached Files

  6. #6
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Select specific MultiPage in a UserForm with other pages grayed out

    I hope I understood you right:

    1. Active page is enabled, all others are not until you press Next button
    2. As soon as you get to the page 4 and press Save button, all the pages fields cleaned up, first page enabled, rest pages are disabled.
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1