Prev: Windows 7 Sendkeys
Next: Control Layout
From: Kirk on 21 May 2010 18:45 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 are: 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?
From: Linq Adams via AccessMonster.com on 21 May 2010 21:09 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 are: 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/Forums.aspx/access-forms/201005/1
|
Pages: 1 Prev: Windows 7 Sendkeys Next: Control Layout |