Link to home
Start Free TrialLog in
Avatar of Fordraiders
FordraidersFlag for United States of America

asked on

tabctrl with page click event

access 2010 vba

I have a tabctrl127
I have several pages
my specific page52

I have code in the click event of that page.
I also have events happening on the other pages

My code will not execute on this page unless i click in the body of the page..I need it to fire when someone clicks on the actual "Tab"

The other tabs work fine...


Thanks
fordraiders
ASKER CERTIFIED SOLUTION
Avatar of Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1)
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Fordraiders

ASKER

Rey,
I currently have the code in the "Click_Event" on that Page   .
No issues with the other pagetabs...just this one??

dp
check the property sheet of the TabControl and see if you have Event Procedure in the Click Event of the Tab.
yes, its there...I click in the middle of the page...then it fires,,,
can you upload a copy of the db?
I wish i could ....connects to sql server...company tables...
what codes do you have in the click event of the tab?
used this :
Private Sub TabCtl27_Change()
Dim str As String
Dim str_case  As String
Dim YES_YOU_CAN_EDIT As Boolean
Select Case Me.TabCtl27.Value
     Case Is = 4
        Call Page53_Click
     Case Is = 1
        Call Page29_Click
     Case Is = 2
        Call Page51_Click
     Case Is = 3
        Call Page52_Click


works fine now
I use the Change event

I also like to use the syntax:

SELECT CASE Me.tabCtl27.pages(me.tabCtl27).Caption
    Case "Some Caption"
        'do something
    Case "Some other caption"

    Case Else
End Select

Although the syntax on the first line is hard to read, this syntax alleviates the problem which can occur when someone decides that they need to change the order of the pages in the tab control.

I also like to give my tab controls a name which has some meaning, "tabCtl27" has no meaning.