Hi, this sounds like a simple question, but I can't find the answer
anywhere.

I have a userform with a front page and some tab pages that are not
visible to the user.

There is a command button on the front page. When this is clicked, tab
page 2 becomes visible, as planned. However, the focus remains on the
front page. I want the tab page 2 to become visible and also become the
main displayed page, rather than leaving page 1 as the main displayed
page.

I've tried various things with "show" and "load" etc, but I get errors
every time.

If someone can put me right, I'd be very grateful.

Regards, Will

Re: Opening a tab page from a command button by Jean-Guy

Jean-Guy
Fri Oct 28 15:11:10 CDT 2005

willcarter@lycos.com was telling us:
willcarter@lycos.com nous racontait que :

> Hi, this sounds like a simple question, but I can't find the answer
> anywhere.
>
> I have a userform with a front page and some tab pages that are not
> visible to the user.
>
> There is a command button on the front page. When this is clicked, tab
> page 2 becomes visible, as planned. However, the focus remains on the
> front page. I want the tab page 2 to become visible and also become
> the main displayed page, rather than leaving page 1 as the main
> displayed page.
>
> I've tried various things with "show" and "load" etc, but I get errors
> every time.
>
> If someone can put me right, I'd be very grateful.

Show us your "OnClick" event code.

--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org



Re: Opening a tab page from a command button by willcarter

willcarter
Sun Oct 30 07:26:51 CST 2005

Well, at the moment the relevant code is simply:

Private Sub CommandButton1_Click()
MultiPage1.Pages("Page2").Visible = True
End Sub

This is on the Page1 button. It makes Page 2 visible, which is fine,
but I want the user to be presented with Page2. Everything I've tried
makes Page2 visible but leaves the focus on Page1.

It must be a simple instruction but Ican't find it!


Re: Opening a tab page from a command button by Jean-Guy

Jean-Guy
Mon Oct 31 07:18:49 CST 2005

willcarter@lycos.com was telling us:
willcarter@lycos.com nous racontait que :

> Well, at the moment the relevant code is simply:
>
> Private Sub CommandButton1_Click()
> MultiPage1.Pages("Page2").Visible = True
> End Sub
>
> This is on the Page1 button. It makes Page 2 visible, which is fine,
> but I want the user to be presented with Page2. Everything I've tried
> makes Page2 visible but leaves the focus on Page1.
>
> It must be a simple instruction but Ican't find it!

Use SetFocus to set the focus (!!!) on a control on page 2.

Just Type "SetFocus" in the VBA editor in your CommandButton1_Click code,
select it and hit F1 to get to its help page to see some examples.


--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org