tabbed control "click" event firing issues

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
 
S

Sandra Daigle

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.
 
M

Marshall Barton

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top