Results 1 to 11 of 11
  1. #1
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Northern, California, USA
    Posts
    1,886
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Userform Page Tabs (97 SR2)

    For some reason, VBA is not identifying my page tab names as objects...

    Any idea how I might activate a page tab? The tab object is named MPDetails, with subtabs named pgDetails, pgItems, pgCalls. I would think that MPDetails.pgDetails.Visible = False would hide that particular tab, but it's not recognizing the object..

    <img src=/S/help.gif border=0 alt=help width=23 height=15> Thanks!
    <IMG SRC=http://www.wopr.com/w3tuserpics/Kel_sig.gif>
    Moderator:<font color=448800> Pix Place, Internet Explorer</font color=448800>
    <small>www.kvisions.com

  2. #2
    Bronze Lounger
    Join Date
    Jun 2001
    Location
    New York, New York, Lebanon
    Posts
    1,449
    Thanks
    1
    Thanked 1 Time in 1 Post

    Re: Userform Page Tabs (97 SR2)

    DrkRealm

    I guess to change tabs you assign the value to it to match the page you want to display something like:

    With UserForm
    .MultiPageControl.Value = 1 '/to change to the second page.
    End With

    The first page value = 0 and the second page value is 1 and the third is 2 and you go on like that.

    Wassim
    <img src=/S/compute.gif border=0 alt=compute width=40 height=20> in the <img src=/S/bagged.gif border=0 alt=bagged width=22 height=22>

  3. #3
    3 Star Lounger
    Join Date
    Mar 2001
    Location
    Silicon Valley, California, USA
    Posts
    273
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Userform Page Tabs (97 SR2)

    Where is this object located? For example, if it is embedded on the first worksheet of a workbook, and some other worksheet is the active sheet, you are not giving VBA enough information about which multipage control you are talking about (even if there is only one in your workbook). In such a case, you would have to change the code to something like this:

    <pre>Sheets("Sheet1").MPDetails.pgDetails.Visibl e = False
    </pre>


    If this control is on a form, the code should work if it is in the code module for the form itself. However, if the code is in a separate module, you will have to call out the form explicitly, like this:

    <pre>UserForm.MPDetails.pgDetails.Visible = False
    </pre>


  4. #4
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Northern, California, USA
    Posts
    1,886
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Userform Page Tabs (97 SR2)

    it's in the form itself... I've pinpointed exactly where it is, but it's not recognizing it as an object.. <img src=/S/confused.gif border=0 alt=confused width=15 height=20>
    <IMG SRC=http://www.wopr.com/w3tuserpics/Kel_sig.gif>
    Moderator:<font color=448800> Pix Place, Internet Explorer</font color=448800>
    <small>www.kvisions.com

  5. #5
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Northern, California, USA
    Posts
    1,886
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Userform Page Tabs (97 SR2)

    Is it possible to change properties of a specific tab using this method?

    Thanks!
    <IMG SRC=http://www.wopr.com/w3tuserpics/Kel_sig.gif>
    Moderator:<font color=448800> Pix Place, Internet Explorer</font color=448800>
    <small>www.kvisions.com

  6. #6
    Bronze Lounger
    Join Date
    Jun 2001
    Location
    New York, New York, Lebanon
    Posts
    1,449
    Thanks
    1
    Thanked 1 Time in 1 Post

    Re: Userform Page Tabs (97 SR2)

    DrkRealm

    Yes, but what properties do you have in mind?

    I think you have a couple, like Font, and Background and foreground color and height and width.

    Try Intellisense and see what come up.

    Wassim
    <img src=/S/compute.gif border=0 alt=compute width=40 height=20> in the <img src=/S/bagged.gif border=0 alt=bagged width=22 height=22>

  7. #7
    3 Star Lounger
    Join Date
    Mar 2001
    Location
    Silicon Valley, California, USA
    Posts
    273
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Userform Page Tabs (97 SR2)

    What do you mean by, "it's not recognized as an object"? Specifically, what are you refering to by "it" and what do you mean by "not recognized"? What are the specific symptoms? What do you try to do, what do you expect to happen, and what happens instead?

  8. #8
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Northern, California, USA
    Posts
    1,886
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Userform Page Tabs (97 SR2)

    The code is in the userform object.

    The code: MyDetails.pgDetails.Show = False is not proper syntax. E.G. it does nothing. The system doesn't recognize pgDetails as an object. This means I can't hide the tab, change it's color, etc.

    Try it! build a simple userform with a multi-page control and you'll see what I mean. <img src=/S/smile.gif border=0 alt=smile width=15 height=15>
    <IMG SRC=http://www.wopr.com/w3tuserpics/Kel_sig.gif>
    Moderator:<font color=448800> Pix Place, Internet Explorer</font color=448800>
    <small>www.kvisions.com

  9. #9
    3 Star Lounger
    Join Date
    Mar 2001
    Location
    Silicon Valley, California, USA
    Posts
    273
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Userform Page Tabs (97 SR2)

    OK, I see what you are getting at. According to the Help for the Pages collection, you have to refer to a single page by index number or by name. For example:

    <pre>MultiPage1.Pages(0).Visible = False
    </pre>


    This will hide the first tab on MultiPage1.

    Apparently it is impossible to refer to a single page as a "stand-alone" object, unless you do something like this:

    <pre>Dim pgDetails
    Set pgDetails = MultipPage1.Pages(0)
    pgDetails.Visible = False
    </pre>


    This will accomplish the same results as the first block of code.

    Meanwhile, color is not among the properties you have available for changing, either through code or manually.

  10. #10
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    South Carolina, USA
    Posts
    7,295
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Userform Page Tabs (97 SR2)

    I haven't worked with this, so I haven't tried this.

    Have you tried:

    <pre> Myform.MPDetails.Pages("pgDetails").Visible = False
    </pre>

    Legare Coleman

  11. #11
    3 Star Lounger
    Join Date
    Mar 2001
    Location
    Silicon Valley, California, USA
    Posts
    273
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Userform Page Tabs (97 SR2)

    Legare,

    That should work fine!

    JIM

Posting Permissions

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