Tab Control and on click events.

  • Thread starter Thread starter Mike
  • Start date Start date
M

Mike

How come the label of the tab does not register the on
click event?

For example, when the user clicks a tab, I want it to
switch pages, but I also want to change the record source
of a subform. However, the on click event is not activated
when clicking the tab label.

__________ ___________
/Hello \/Good Bye \_________________________
| |
| |

For example, when the user clicks "Hello", I want it to
register an event, so I figured it would be the on click
event. However, this does not seem to be the case.

Is there any way I can make it so that when the user
clicks "Hello", it can register a Macro or VB Code?
 
In design mode, click the background of the tab control to the right of the
Good Bye tab. You will now have a Change event available for the tab
control. This event will fire when you move from one page to the next.
 
______ ________ ____________
/Hello \/Good Bye\/Good Morning\_________________

Thank you for the help. However, I need it to be a little
more specific than that. If the On Change event is
activated, how do I find out which tab was click?

This is a fictional example:
I am currently in the "Hello" tab, and a text box
says "Hello, Mike". Now, I click on the Good Bye tab, so
it can display "Good Bye, Mike". The On Change event is
activated, but how do I know whether or not the user
clicked on the "Good Bye" or "Good Morning" tab? I want
the text box to display "Good Bye, Mike" or "Good Morning,
Mike" depending on which tab is selected.
Is there a property for the tab control, such as
TabControl.CurrentPage or something?

Any further help would be greatly appreciated.
 
______ ________ ____________
/Hello \/Good Bye\/Good Morning\_________________

Thank you for the help. However, I need it to be a little
more specific than that. If the On Change event is
activated, how do I find out which tab was click?

This is a fictional example:
I am currently in the "Hello" tab, and a text box
says "Hello, Mike". Now, I click on the Good Bye tab, so
it can display "Good Bye, Mike". The On Change event is
activated, but how do I know whether or not the user
clicked on the "Good Bye" or "Good Morning" tab? I want
the text box to display "Good Bye, Mike" or "Good Morning,
Mike" depending on which tab is selected.
Is there a property for the tab control, such as
TabControl.CurrentPage or something?

Any further help would be greatly appreciated.
 
Mike said:
______ ________ ____________
/Hello \/Good Bye\/Good Morning\_________________

Thank you for the help. However, I need it to be a little
more specific than that. If the On Change event is
activated, how do I find out which tab was click?

The Value property of the TabControl will correspond to the index of the
selected page.
 
Back
Top