Code for Cmd button to select tab page on form?

Goli

New member
Local time
Today, 04:57
Joined
Jan 21, 2008
Messages
6
HI there,

I am still new to VBA and need some help.

I need to write some code which allows me to use a cmd button (using on Click) to select a tab page from a single form?

I have already got some code which allows the user to tab through each field and through each tab page on this single form, but I can't get the same thing to work on click from the cmd button.

Any Ideas?

Thanks for your time.

G

:confused:
 
This kind of thing?

Me.PageName.SetFocus
 
Thanks,
Looks good!
How would I use this to set the focus for a specific tab and make sure the click button would take me there?
 
Won't go back to the same tab page

I have tried this piece of code which works to an extent.

The only problem is that it doesn't always take you back to the same page,

It seems to take you to any page you have not yet tabbed through in the form?

Is there a way of making the command button always go to the one tab page?

Thanks,

G
 
Um, Paul gave you the syntax - You use the tab's page name:

Me.YourTabPage.SetFocus

NOT the tab control name, but the name of the individual tab (known as a page).
 
It's Alive!!

Thanks Guys!

I had a similar bit of code interfering with it on exit!

It wouldn't content with both.

Regards,

G

:D
 

Users who are viewing this thread

Back
Top Bottom