Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Multipage control on Excel VBA forms

Hi guys,

I've been writing a small VBA program in Excel. Part of it involves a form
that asks the user for various inputs. I've used a multipage control to
break the form up into two sections.

The trouble I am having is that once the user presses an OK button, I have a
routine that validates all of the entries to make sure that they make sense
and are consistent with each other. If any aren't, the program displays a
message box and then directs the focus to the offending control. However, if
the control in question is on a different tab to the one that was visible
when the user clicked OK, I can't use the SetFocus method to direct the
focus to it. I think somehow I need to display the tab it is on first and
then set the focus.

So my question is basically, how do I switch between tabs of a multipage
control programatically? I have been through the Excel VBA helpfile which is
not particularly helpful! I have also tried all the obvious combinations I
can think of but without any success.

Would really appreciate any advice anyone could offer.

Regards,

James.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,080
Default Multipage control on Excel VBA forms

Not very intuitive ...

MultiPage1.Value = 0 'or 1

--

Vasant



"James Garner" wrote in message
...
Hi guys,

I've been writing a small VBA program in Excel. Part of it involves a form
that asks the user for various inputs. I've used a multipage control to
break the form up into two sections.

The trouble I am having is that once the user presses an OK button, I have

a
routine that validates all of the entries to make sure that they make

sense
and are consistent with each other. If any aren't, the program displays a
message box and then directs the focus to the offending control. However,

if
the control in question is on a different tab to the one that was visible
when the user clicked OK, I can't use the SetFocus method to direct the
focus to it. I think somehow I need to display the tab it is on first and
then set the focus.

So my question is basically, how do I switch between tabs of a multipage
control programatically? I have been through the Excel VBA helpfile which

is
not particularly helpful! I have also tried all the obvious combinations I
can think of but without any success.

Would really appreciate any advice anyone could offer.

Regards,

James.




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Multipage control on Excel VBA forms

Many thanks, Vasant - that does the job perfectly.

You are right though - it would have taken me a while to guess that was the
way to do it!

Regards,

James.


"Vasant Nanavati" <vasantn *AT* aol *DOT* com wrote in message
...
Not very intuitive ...

MultiPage1.Value = 0 'or 1

--

Vasant



"James Garner" wrote in message
...
Hi guys,

I've been writing a small VBA program in Excel. Part of it involves a

form
that asks the user for various inputs. I've used a multipage control to
break the form up into two sections.

The trouble I am having is that once the user presses an OK button, I

have
a
routine that validates all of the entries to make sure that they make

sense
and are consistent with each other. If any aren't, the program displays

a
message box and then directs the focus to the offending control.

However,
if
the control in question is on a different tab to the one that was

visible
when the user clicked OK, I can't use the SetFocus method to direct the
focus to it. I think somehow I need to display the tab it is on first

and
then set the focus.

So my question is basically, how do I switch between tabs of a multipage
control programatically? I have been through the Excel VBA helpfile

which
is
not particularly helpful! I have also tried all the obvious combinations

I
can think of but without any success.

Would really appreciate any advice anyone could offer.

Regards,

James.






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Option Buttons, Forms Control, Excel 2007 - 3 options Paula Excel Worksheet Functions 6 February 6th 09 07:36 PM
Difference between a Forms Control verus Active-X Control funGT350 Excel Discussion (Misc queries) 6 May 6th 08 11:20 PM
Forms Control captsamm(remove)@comcast.net Excel Discussion (Misc queries) 1 February 13th 08 10:37 PM
MultiPage control Patrick Simonds Excel Worksheet Functions 1 August 5th 06 05:32 PM
Multipage control Neil Excel Programming 2 September 15th 03 01:24 PM


All times are GMT +1. The time now is 02:20 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"