View Single Post
  #2  
Old May 22nd, 2010, 02:09 AM posted to microsoft.public.access.forms
Linq Adams via AccessMonster.com
external usenet poster
 
Posts: 1,474
Default 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