If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
trigger an event by changing pages in a tab control form
How can I trigger a code event by switching pages in a form with a tab control?
In design view with the page selected the only events that show up on the property sheet a On Click (which does not activate on clickign the tab but the page itself), on Dbl click (same issue) and 3 mouse actions. Any other way to activate code only when the target page is selected by clicking on it's tab? |
#2
|
|||
|
|||
trigger an event by changing pages in a tab control form
Your problem is that you have to select the Tabbed Control, not an individual
page. The event to use is the Tabbed Control OnChange event. Here's an example: Private Sub YourTabbedControlName_Change() Select Case YourTabbedControlName Case 0 ‘First Page ‘Code for Page 1 Case 1 ‘Second page ‘Code for Page 2 Case 2 ‘Third page ‘Code for Page 3 End Select End Sub Notice that the pages are Zero-based, i.e. the first page is 0, the second page is 1, etc. Just replace YourTabbedControlName with the actual name of your Tabbed Control. Kirk wrote: How can I trigger a code event by switching pages in a form with a tab control? In design view with the page selected the only events that show up on the property sheet a On Click (which does not activate on clickign the tab but the page itself), on Dbl click (same issue) and 3 mouse actions. Any other way to activate code only when the target page is selected by clicking on it's tab? -- There's ALWAYS more than one way to skin a cat! Answers/posts based on Access 2000/2003 Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...forms/201005/1 |
Thread Tools | |
Display Modes | |
|
|