tab events

  • Thread starter Thread starter Jared Wells
  • Start date Start date
J

Jared Wells

Guest
I'm having some trouble with events on tab controls. I find tabs helpful in navigating multiple subforms. However, I would also like the "On Click" event for each tab to run a macro - go to a control on the main form (not the subforms) and look up a specific record. The macro I've created works when activated from a button or another control, but not when I set it for a specific tab event. Any idea why?
 
You have to use On Change event of the TAB CONTROL, not each single page. Check the code below out.

Code:
Private Sub TabCtl0_Change()

    Select Case Me!TabCtl0.Value 'Returns Page Index
        Case 0 'Page Index for Page 1
            ' Run your macro1 here
        Case 1 'Page Index for Page 2
            ' Run your macro2 here
    End Select
    
End Sub
 

Users who are viewing this thread

Back
Top Bottom