+ Reply to Thread
Results 1 to 6 of 6

MultiPage Control problem

  1. #1
    Patrick Simonds
    Guest

    MultiPage Control problem

    I have a UserForm on which I have placed a MultiPage control. The MultiPage1
    control has 4 pages (Data, Income, Outstanding and Instructions). I use a
    variant of the code below to bring up the UserForm with the proper page on
    the MultiPage control displayed, and it works fine.

    Now my problem is that on the Income page I have placed another MultiPage
    control (MultiPage2 control) with 6 pages (one for each month January -
    June) and I can not figure out how to alter the code below to bring up one
    of the monthly pages on the MultiPage2 control. When I run the code I get an
    Invalid procedure call or argument error and the line "Data_Input.Show" is
    highlighted.



    Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)

    If Not Application.Intersect _
    (Target, Me.Range("B3:I3,K3")) Is Nothing Then
    myMPPageName = "January"
    Data_Input.Show

    End If

    End Sub



  2. #2
    Tom Ogilvy
    Guest

    Re: MultiPage Control problem

    Sub ShowForm()
    Load Data_Input
    Data_Input.MultiPage1.Value = 1
    Data_Input.MultiPage1.Pages(1).MultiPage2.Value = 0
    Data_Input.Show
    End Sub

    worked fine for me.

    The second page of the Multipage1 was shown (Income) and on it, the first
    page of the Multipage2 control was shown (January)

    you can refer to a page with its name as shown here (from the immediate
    window):
    ? data_Input.Multipage1.Pages("Income").Multipage2.Pages("January").Caption
    January

    But you can't do something like this:
    Data_Input.MultiPage1.Value = "Income"
    Data_Input.MultiPage1.Pages("Income").MultiPage2.Value = "January"
    Data_Input.Show



    --
    Regards,
    Tom Ogilvy

    "Patrick Simonds" <[email protected]> wrote in message
    news:[email protected]...
    >I have a UserForm on which I have placed a MultiPage control. The
    >MultiPage1 control has 4 pages (Data, Income, Outstanding and
    >Instructions). I use a variant of the code below to bring up the UserForm
    >with the proper page on the MultiPage control displayed, and it works fine.
    >
    > Now my problem is that on the Income page I have placed another MultiPage
    > control (MultiPage2 control) with 6 pages (one for each month January -
    > June) and I can not figure out how to alter the code below to bring up one
    > of the monthly pages on the MultiPage2 control. When I run the code I get
    > an Invalid procedure call or argument error and the line "Data_Input.Show"
    > is highlighted.
    >
    >
    >
    > Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
    >
    > If Not Application.Intersect _
    > (Target, Me.Range("B3:I3,K3")) Is Nothing Then
    > myMPPageName = "January"
    > Data_Input.Show
    >
    > End If
    >
    > End Sub
    >
    >




  3. #3
    Patrick Simonds
    Guest

    Re: MultiPage Control problem

    Thank you sir, but I still get the Invalid procedure call or argument error
    and the "Load Data_Input" is highlighted. I did change your original code to
    change Data_Input.MultiPage1.Value = 1 to a Value of 2 to point at the 3rd
    page (Income).


    If Not Application.Intersect _
    (Target, Me.Range("B3:I3,K3,C12")) Is Nothing Then

    Load Data_Input
    Data_Input.MultiPage1.Value = 2
    Data_Input.MultiPage1.Pages(2).MultiPage2.Value = 0
    Data_Input.Show

    End If


    "Tom Ogilvy" <[email protected]> wrote in message
    news:%[email protected]...
    > Sub ShowForm()
    > Load Data_Input
    > Data_Input.MultiPage1.Value = 1
    > Data_Input.MultiPage1.Pages(1).MultiPage2.Value = 0
    > Data_Input.Show
    > End Sub
    >
    > worked fine for me.
    >
    > The second page of the Multipage1 was shown (Income) and on it, the first
    > page of the Multipage2 control was shown (January)
    >
    > you can refer to a page with its name as shown here (from the immediate
    > window):
    > ?
    > data_Input.Multipage1.Pages("Income").Multipage2.Pages("January").Caption
    > January
    >
    > But you can't do something like this:
    > Data_Input.MultiPage1.Value = "Income"
    > Data_Input.MultiPage1.Pages("Income").MultiPage2.Value = "January"
    > Data_Input.Show
    >
    >
    >
    > --
    > Regards,
    > Tom Ogilvy
    >
    > "Patrick Simonds" <[email protected]> wrote in message
    > news:[email protected]...
    >>I have a UserForm on which I have placed a MultiPage control. The
    >>MultiPage1 control has 4 pages (Data, Income, Outstanding and
    >>Instructions). I use a variant of the code below to bring up the UserForm
    >>with the proper page on the MultiPage control displayed, and it works
    >>fine.
    >>
    >> Now my problem is that on the Income page I have placed another MultiPage
    >> control (MultiPage2 control) with 6 pages (one for each month January -
    >> June) and I can not figure out how to alter the code below to bring up
    >> one of the monthly pages on the MultiPage2 control. When I run the code I
    >> get an Invalid procedure call or argument error and the line
    >> "Data_Input.Show" is highlighted.
    >>
    >>
    >>
    >> Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
    >>
    >> If Not Application.Intersect _
    >> (Target, Me.Range("B3:I3,K3")) Is Nothing Then
    >> myMPPageName = "January"
    >> Data_Input.Show
    >>
    >> End If
    >>
    >> End Sub
    >>
    >>

    >
    >




  4. #4
    Patrick Simonds
    Guest

    Re: MultiPage Control problem

    Sorry the problem is not with what you helped me with but in my Userform
    initialization. So I will check that out. Again thanks for your help.


    "Patrick Simonds" <[email protected]> wrote in message
    news:[email protected]...
    > Thank you sir, but I still get the Invalid procedure call or argument
    > error and the "Load Data_Input" is highlighted. I did change your original
    > code to change Data_Input.MultiPage1.Value = 1 to a Value of 2 to point at
    > the 3rd page (Income).
    >
    >
    > If Not Application.Intersect _
    > (Target, Me.Range("B3:I3,K3,C12")) Is Nothing Then
    >
    > Load Data_Input
    > Data_Input.MultiPage1.Value = 2
    > Data_Input.MultiPage1.Pages(2).MultiPage2.Value = 0
    > Data_Input.Show
    >
    > End If
    >
    >
    > "Tom Ogilvy" <[email protected]> wrote in message
    > news:%[email protected]...
    >> Sub ShowForm()
    >> Load Data_Input
    >> Data_Input.MultiPage1.Value = 1
    >> Data_Input.MultiPage1.Pages(1).MultiPage2.Value = 0
    >> Data_Input.Show
    >> End Sub
    >>
    >> worked fine for me.
    >>
    >> The second page of the Multipage1 was shown (Income) and on it, the first
    >> page of the Multipage2 control was shown (January)
    >>
    >> you can refer to a page with its name as shown here (from the immediate
    >> window):
    >> ?
    >> data_Input.Multipage1.Pages("Income").Multipage2.Pages("January").Caption
    >> January
    >>
    >> But you can't do something like this:
    >> Data_Input.MultiPage1.Value = "Income"
    >> Data_Input.MultiPage1.Pages("Income").MultiPage2.Value = "January"
    >> Data_Input.Show
    >>
    >>
    >>
    >> --
    >> Regards,
    >> Tom Ogilvy
    >>
    >> "Patrick Simonds" <[email protected]> wrote in message
    >> news:[email protected]...
    >>>I have a UserForm on which I have placed a MultiPage control. The
    >>>MultiPage1 control has 4 pages (Data, Income, Outstanding and
    >>>Instructions). I use a variant of the code below to bring up the UserForm
    >>>with the proper page on the MultiPage control displayed, and it works
    >>>fine.
    >>>
    >>> Now my problem is that on the Income page I have placed another
    >>> MultiPage control (MultiPage2 control) with 6 pages (one for each month
    >>> January - June) and I can not figure out how to alter the code below to
    >>> bring up one of the monthly pages on the MultiPage2 control. When I run
    >>> the code I get an Invalid procedure call or argument error and the line
    >>> "Data_Input.Show" is highlighted.
    >>>
    >>>
    >>>
    >>> Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
    >>>
    >>> If Not Application.Intersect _
    >>> (Target, Me.Range("B3:I3,K3")) Is Nothing Then
    >>> myMPPageName = "January"
    >>> Data_Input.Show
    >>>
    >>> End If
    >>>
    >>> End Sub
    >>>
    >>>

    >>
    >>

    >
    >




  5. #5
    Patrick Simonds
    Guest

    Re: MultiPage Control problem

    My problem seems to resolve around the code at the beginning of my UserForm
    Intialization routine. Some how I assume I must also account for the
    MultiPage2.



    With Me.MultiPage1
    .Value = .Pages(myMPPageName).Index
    End With





    "Patrick Simonds" <[email protected]> wrote in message
    news:[email protected]...
    > Sorry the problem is not with what you helped me with but in my Userform
    > initialization. So I will check that out. Again thanks for your help.
    >
    >
    > "Patrick Simonds" <[email protected]> wrote in message
    > news:[email protected]...
    >> Thank you sir, but I still get the Invalid procedure call or argument
    >> error and the "Load Data_Input" is highlighted. I did change your
    >> original code to change Data_Input.MultiPage1.Value = 1 to a Value of 2
    >> to point at the 3rd page (Income).
    >>
    >>
    >> If Not Application.Intersect _
    >> (Target, Me.Range("B3:I3,K3,C12")) Is Nothing Then
    >>
    >> Load Data_Input
    >> Data_Input.MultiPage1.Value = 2
    >> Data_Input.MultiPage1.Pages(2).MultiPage2.Value = 0
    >> Data_Input.Show
    >>
    >> End If
    >>
    >>
    >> "Tom Ogilvy" <[email protected]> wrote in message
    >> news:%[email protected]...
    >>> Sub ShowForm()
    >>> Load Data_Input
    >>> Data_Input.MultiPage1.Value = 1
    >>> Data_Input.MultiPage1.Pages(1).MultiPage2.Value = 0
    >>> Data_Input.Show
    >>> End Sub
    >>>
    >>> worked fine for me.
    >>>
    >>> The second page of the Multipage1 was shown (Income) and on it, the
    >>> first page of the Multipage2 control was shown (January)
    >>>
    >>> you can refer to a page with its name as shown here (from the immediate
    >>> window):
    >>> ?
    >>> data_Input.Multipage1.Pages("Income").Multipage2.Pages("January").Caption
    >>> January
    >>>
    >>> But you can't do something like this:
    >>> Data_Input.MultiPage1.Value = "Income"
    >>> Data_Input.MultiPage1.Pages("Income").MultiPage2.Value = "January"
    >>> Data_Input.Show
    >>>
    >>>
    >>>
    >>> --
    >>> Regards,
    >>> Tom Ogilvy
    >>>
    >>> "Patrick Simonds" <[email protected]> wrote in message
    >>> news:[email protected]...
    >>>>I have a UserForm on which I have placed a MultiPage control. The
    >>>>MultiPage1 control has 4 pages (Data, Income, Outstanding and
    >>>>Instructions). I use a variant of the code below to bring up the
    >>>>UserForm with the proper page on the MultiPage control displayed, and it
    >>>>works fine.
    >>>>
    >>>> Now my problem is that on the Income page I have placed another
    >>>> MultiPage control (MultiPage2 control) with 6 pages (one for each month
    >>>> January - June) and I can not figure out how to alter the code below to
    >>>> bring up one of the monthly pages on the MultiPage2 control. When I run
    >>>> the code I get an Invalid procedure call or argument error and the line
    >>>> "Data_Input.Show" is highlighted.
    >>>>
    >>>>
    >>>>
    >>>> Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
    >>>>
    >>>> If Not Application.Intersect _
    >>>> (Target, Me.Range("B3:I3,K3")) Is Nothing Then
    >>>> myMPPageName = "January"
    >>>> Data_Input.Show
    >>>>
    >>>> End If
    >>>>
    >>>> End Sub
    >>>>
    >>>>
    >>>
    >>>

    >>
    >>

    >
    >




  6. #6
    Tom Ogilvy
    Guest

    Re: MultiPage Control problem

    I didn't and I don't see why.

    --
    Regards,
    Tom Ogilvy


    "Patrick Simonds" wrote:

    > My problem seems to resolve around the code at the beginning of my UserForm
    > Intialization routine. Some how I assume I must also account for the
    > MultiPage2.
    >
    >
    >
    > With Me.MultiPage1
    > .Value = .Pages(myMPPageName).Index
    > End With
    >
    >
    >
    >
    >
    > "Patrick Simonds" <[email protected]> wrote in message
    > news:[email protected]...
    > > Sorry the problem is not with what you helped me with but in my Userform
    > > initialization. So I will check that out. Again thanks for your help.
    > >
    > >
    > > "Patrick Simonds" <[email protected]> wrote in message
    > > news:[email protected]...
    > >> Thank you sir, but I still get the Invalid procedure call or argument
    > >> error and the "Load Data_Input" is highlighted. I did change your
    > >> original code to change Data_Input.MultiPage1.Value = 1 to a Value of 2
    > >> to point at the 3rd page (Income).
    > >>
    > >>
    > >> If Not Application.Intersect _
    > >> (Target, Me.Range("B3:I3,K3,C12")) Is Nothing Then
    > >>
    > >> Load Data_Input
    > >> Data_Input.MultiPage1.Value = 2
    > >> Data_Input.MultiPage1.Pages(2).MultiPage2.Value = 0
    > >> Data_Input.Show
    > >>
    > >> End If
    > >>
    > >>
    > >> "Tom Ogilvy" <[email protected]> wrote in message
    > >> news:%[email protected]...
    > >>> Sub ShowForm()
    > >>> Load Data_Input
    > >>> Data_Input.MultiPage1.Value = 1
    > >>> Data_Input.MultiPage1.Pages(1).MultiPage2.Value = 0
    > >>> Data_Input.Show
    > >>> End Sub
    > >>>
    > >>> worked fine for me.
    > >>>
    > >>> The second page of the Multipage1 was shown (Income) and on it, the
    > >>> first page of the Multipage2 control was shown (January)
    > >>>
    > >>> you can refer to a page with its name as shown here (from the immediate
    > >>> window):
    > >>> ?
    > >>> data_Input.Multipage1.Pages("Income").Multipage2.Pages("January").Caption
    > >>> January
    > >>>
    > >>> But you can't do something like this:
    > >>> Data_Input.MultiPage1.Value = "Income"
    > >>> Data_Input.MultiPage1.Pages("Income").MultiPage2.Value = "January"
    > >>> Data_Input.Show
    > >>>
    > >>>
    > >>>
    > >>> --
    > >>> Regards,
    > >>> Tom Ogilvy
    > >>>
    > >>> "Patrick Simonds" <[email protected]> wrote in message
    > >>> news:[email protected]...
    > >>>>I have a UserForm on which I have placed a MultiPage control. The
    > >>>>MultiPage1 control has 4 pages (Data, Income, Outstanding and
    > >>>>Instructions). I use a variant of the code below to bring up the
    > >>>>UserForm with the proper page on the MultiPage control displayed, and it
    > >>>>works fine.
    > >>>>
    > >>>> Now my problem is that on the Income page I have placed another
    > >>>> MultiPage control (MultiPage2 control) with 6 pages (one for each month
    > >>>> January - June) and I can not figure out how to alter the code below to
    > >>>> bring up one of the monthly pages on the MultiPage2 control. When I run
    > >>>> the code I get an Invalid procedure call or argument error and the line
    > >>>> "Data_Input.Show" is highlighted.
    > >>>>
    > >>>>
    > >>>>
    > >>>> Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
    > >>>>
    > >>>> If Not Application.Intersect _
    > >>>> (Target, Me.Range("B3:I3,K3")) Is Nothing Then
    > >>>> myMPPageName = "January"
    > >>>> Data_Input.Show
    > >>>>
    > >>>> End If
    > >>>>
    > >>>> End Sub
    > >>>>
    > >>>>
    > >>>
    > >>>
    > >>
    > >>

    > >
    > >

    >
    >
    >


+ 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