tabbed control "click" event firing issues

  • Thread starter Thread starter Brad Pears
  • Start date Start date
B

Brad Pears

I have a screen on which I am using a tabbed control. On thgis tabbed
control, I have three pages (tabs). On one of them, when the user sle4ects
that particular tab, I want to run some custom code.

I assumed that in design mode for that tab, I would insert the code I want
on the page "click" event. Not so. It fires when the user clicks on a blank
area of the page - not on the actual tab of the control - rediculous in my
opinion!!!! I must be missing something. I has to be easy!!

Where do I place code that I want to fire when the user clicks on one of the
tabs?

Thanks,

Brad
 
Try the Change Event of the tab control instead. It fires when the value of
the tabcontrol changes. Keep in mind that the value of the tab control is
actually the page index of the current tab page where 0 refers to the first
tab page.
 
Brad said:
I have a screen on which I am using a tabbed control. On thgis tabbed
control, I have three pages (tabs). On one of them, when the user sle4ects
that particular tab, I want to run some custom code.

I assumed that in design mode for that tab, I would insert the code I want
on the page "click" event. Not so. It fires when the user clicks on a blank
area of the page - not on the actual tab of the control - rediculous in my
opinion!!!! I must be missing something. I has to be easy!!

Where do I place code that I want to fire when the user clicks on one of the
tabs?


Yeah, the Click event is nearly useless. Use the tab
control's Change event and check which page is the active
page:

Select Case Me.tabcontrol
Case 0
'do something for first page
Case 1
'second page code
Case 2
Case Else
'code for pages you didn't specify above
End Select
 
Back
Top