A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

trigger an event by changing pages in a tab control form



 
 
Thread Tools Display Modes
  #1  
Old May 21st, 2010, 11:45 PM posted to microsoft.public.access.forms
Kirk
external usenet poster
 
Posts: 93
Default 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  
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

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 10:16 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.