Tab Onclick...!

scooble

Registered User.
Local time
Today, 20:51
Joined
Oct 25, 2010
Messages
18
I have two Tabs on a form called frmDate
the first tab is called PgBookApts
the second tab is called PgVisualApts

I simply want to display a message box when I click on PgVisualApts, but nothing happens when I enter the code in the OnClick event.

I read somewhere that you should write code for the On change event for the tab control - whats the tab control and where do I find it, and where do I put the code?
 
Your tab control is the tab you created:confused: It is a bit tricky cliking on the tab control itself and not the page.

On the property sheet, select the name of your tab control from the Drop Down list and that will be the tab control selected. Now you will be able to see the Change event in the events tab.
 
The trick for selecting the tab control itself is to click to the right of the last tab page on the control. This blank area is still part of the control but not a page. This will then select the control itself.
 
The trick for selecting the tab control itself is to click to the right of the last tab page on the control. This blank area is still part of the control but not a page. This will then select the control itself.
I've explained that to an OP on here before and they just didn't get it:o
 
Tabbed controls are a little tricky to work with, at first, but worth it!

Your code would look something like this, remembering that the page index is Zero-based:

Code:
Private Sub YourTabbedControlName_Change()
 
 Select Case YourTabbedControlName

  Case 0 '1st page
   MsgBox "1st Page"

  Case 1 '2nd page
    MsgBox "2nd Page"

 End Select

End Sub
Linq ;0)>
 

Users who are viewing this thread

Back
Top Bottom