[AccessD] Access 2007 "On Click" Event on Tab (Page) - NeverFired???

Heenan, Lambert Lambert.Heenan at chartisinsurance.com
Thu Jan 12 15:10:16 CST 2012


That's a common problem. Just a case of MS making a weird decision way back in the past. You'd *think* that the tab control click event is the one you need, but in fact it is the  Change event that you need to use.

Like this: assuming you tab control is called "MenuTab" this code will check the name the tab (the text that appears on the tab itself) that became active after the click and respond as needed.

    Select Case MenuTab.Pages(MenuTab.Value).Name
    Case "Odd-Ball"
		Me.SomeButton_Click ' call the button click event
    Case Else
		' do nothing
    End Select


HTH

Lambert

-----Original Message-----
From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Brad Marks
Sent: Thursday, January 12, 2012 3:53 PM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] Access 2007 "On Click" Event on Tab (Page) - NeverFired???

Stuart,

Thanks for the help.  You are right, the event is fired if one clicks on the background of the tab Page and not on the Tab itself.

The catch is that I would like to be able to fire the event when the Tab itself is selected.

Here is what I am trying to accomplish...

I have a "Real" (non test) Form that has 10 tabs.  Nine of the tabs each has numerous buttons that initiate various reports.  One "odd-ball" Tab only has one button and will never have more than 1.  Instead of selecting the Tab and then pushing the single button inside this Tab, I would like to eliminate the single button and fire up the event when the Tab is selected.  I thought that I could do this with the "On Click"
event, but it appears that this approach will not work.

Thanks again,
Brad    


-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Stuart McLachlan
Sent: Thursday, January 12, 2012 2:40 PM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] Access 2007 "On Click" Event on Tab (Page) - NeverFired???

It works for me.   Click anywhere in  the page which is not covered by a
control and the
message box pops up.  Note - responds to clicks  only if you click on the background of the tab "page", not on  the "tab" itself.

--
Stuart

On 12 Jan 2012 at 14:18, Brad Marks wrote:

> I have a very simple test Form with 2 Tabs (Page1 and Page2).
> 
> In the Property Sheet for both Page1 and Page2, I see an "On Click"
> event.
> 
> However, when I add a MSGBOX to the Event Procedure, it appears that
the
> event is never fired.
> 
> I must be missing something.
> 
> Thanks,
> 
> Brad
> 
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
> 



-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.


-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com



More information about the AccessD mailing list