Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / October 2005

Tip: Looking for answers? Try searching our database.

Opening a tab page from a command button

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
willcarter@lycos.com - 28 Oct 2005 19:29 GMT
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
Jean-Guy Marcil - 28 Oct 2005 21:11 GMT
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.
[quoted text clipped - 12 lines]
>
> If someone can put me right, I'd be very grateful.

Show us your "OnClick" event code.

Signature

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

willcarter@lycos.com - 30 Oct 2005 14:26 GMT
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!
Jean-Guy Marcil - 31 Oct 2005 14:18 GMT
willcarter@lycos.com was telling us:
willcarter@lycos.com nous racontait que :

> Well, at the moment the relevant code is simply:
>
[quoted text clipped - 7 lines]
>
> 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.

Signature

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


Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.