Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default Can I set a page of a Multipage form to active?

My question is three fold.

1.. Can I set a page of my mutipage form to whichever tab I choose using VBA. ??? Something like "Userform1.page(1).active" . I know this is Invalid. I am just giving an example of what I am looking for.
2.. Can I detect which tab the end user is working in?
3.. Also can i set page one as the default page to start in. I know its not a big deal, but everytime I adjust my form object and close it, without making sure that page one is the active page, the next time I start the program, the form init fails... more specifically... "Userform1.NameEntry.SetFocus". The reason of course is because that item is on the first page.

My main goal is this:

I have a multipage form with two tabs or pages

Tab 1) for entering and displaying employee names
Tab 2) for entering their location responsibilities

Each tab has an "add" button, and "addbutton1", which is on page 1, is the default button, ( for the enter key )

When the user switches to tab two, I would like to set "addbutton2.default = True. But I need to know where the user is.

I'm sorry if that was confusing. I was trying to be simple, but make sure enough info was shared.

Thank You
John
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 860
Default Can I set a page of a Multipage form to active?

Hi John,

Please use plain text when posting to the newsgroups - it makes quoting
easier and is much smaller.

The Value property of the MultiPage container is what you're looking for.
It is a zero-based value, so the first tab has value 0, the second value 1,
etc.

So to set the focus to the second tab, you would do this:

MultiPage1.Value=1

To get the current tab, you would do this:

Debug.Print MultiPage1.Value + 1

To set the default, you can either set the Value property at design time (in
the properties window) or in the Form_Initialize event.

--
Regards,

Jake Marx
www.longhead.com


"John T Ingato" wrote in message
...
My question is three fold.

Can I set a page of my mutipage form to whichever tab I choose using VBA.
??? Something like "Userform1.page(1).active" . I know this is Invalid. I
am just giving an example of what I am looking for.
Can I detect which tab the end user is working in?
Also can i set page one as the default page to start in. I know its not a
big deal, but everytime I adjust my form object and close it, without making
sure that page one is the active page, the next time I start the program,
the form init fails... more specifically... "Userform1.NameEntry.SetFocus".
The reason of course is because that item is on the first page.

My main goal is this:

I have a multipage form with two tabs or pages

Tab 1) for entering and displaying employee names
Tab 2) for entering their location responsibilities

Each tab has an "add" button, and "addbutton1", which is on page 1, is the
default button, ( for the enter key )

When the user switches to tab two, I would like to set "addbutton2.default =
True. But I need to know where the user is.

I'm sorry if that was confusing. I was trying to be simple, but make sure
enough info was shared.

Thank You
John

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Can I set a page of a Multipage form to active?

Userform1.Multipage1.value = 0 selects page one. (page numbering is zero
based)

Query this to see what page is active.

Do the first in your userform_Initialize event.

--
Regards,
Tom Ogilvy

John T Ingato wrote in message
...
My question is three fold.

Can I set a page of my mutipage form to whichever tab I choose using VBA.
??? Something like "Userform1.page(1).active" . I know this is Invalid. I
am just giving an example of what I am looking for.
Can I detect which tab the end user is working in?
Also can i set page one as the default page to start in. I know its not a
big deal, but everytime I adjust my form object and close it, without making
sure that page one is the active page, the next time I start the program,
the form init fails... more specifically... "Userform1.NameEntry.SetFocus".
The reason of course is because that item is on the first page.

My main goal is this:

I have a multipage form with two tabs or pages

Tab 1) for entering and displaying employee names
Tab 2) for entering their location responsibilities

Each tab has an "add" button, and "addbutton1", which is on page 1, is the
default button, ( for the enter key )

When the user switches to tab two, I would like to set "addbutton2.default =
True. But I need to know where the user is.

I'm sorry if that was confusing. I was trying to be simple, but make sure
enough info was shared.

Thank You
John


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
MultiPage Form Question NFL Excel Discussion (Misc queries) 4 December 30th 09 02:21 PM
Active X Controls Tabbing from Form Field 2 Form Field Tfrup12 Excel Discussion (Misc queries) 0 February 19th 08 08:15 PM
activate a page of a Multipage in Userform Jeff Excel Discussion (Misc queries) 1 February 8th 08 06:16 PM
Form Button not active YanYan Excel Discussion (Misc queries) 0 August 17th 06 03:17 AM
Active Form during Execution BillCPA Excel Discussion (Misc queries) 0 August 11th 06 03:15 PM


All times are GMT +1. The time now is 03:02 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"