Results 1 to 5 of 5
  1. #1
    Paul H's Avatar
    Paul H is offline Expert
    Windows XP Access 2010 32bit
    Join Date
    Sep 2011
    Location
    Richmond, VA
    Posts
    591

    Tab Control Event

    I have a tab control and I am trying to get it to return a certain value each time a tab it clicked.

    Click image for larger version. 

Name:	tab control.JPG 
Views:	10 
Size:	22.0 KB 
ID:	29731

    I have put a simple piece of code in the tab click event which doesn't run at all.




    Code:
    Private Sub Verify_Click()
    
        X = 0
        MsgBox x
    
    End Sub
    Really I'd just like to grab the index number of the tab, but I'll be satisfied if I can get this to work. I haven't worked a lot with tab controls so maybe I a missing something obvious.

    Please enlighten me.

    Paul

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Use the Change Event of the Tab Control. The Click Event is practically useless.

  3. #3
    Paul H's Avatar
    Paul H is offline Expert
    Windows XP Access 2010 32bit
    Join Date
    Sep 2011
    Location
    Richmond, VA
    Posts
    591
    I should have clarified, I meant the Click Event for the Page, i.e. Click on Verify x = 0 (or page index if I can get it), Click on CO, X = 1, etc. If I can get that through the On Change of the tab control, that would be fine too, but I can't seem to track that value down.

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    You can retrieve the page index from the Change Event. I may not understand your issue.

  5. #5
    Paul H's Avatar
    Paul H is offline Expert
    Windows XP Access 2010 32bit
    Join Date
    Sep 2011
    Location
    Richmond, VA
    Posts
    591
    Far simpler than I was making it. This did the trick. I just didn't know how to capture the index of the active page.

    Code:
    X = Me.TabReportType.Value
    
        Select Case X
        
            Case 0
                MsgBox "Verify"
            Case 1
                MsgBox "Central Office"
            Case 2
                MsgBox "History"
            Case 3
                MsgBox "Current"
            Case 4
                MsgBox "Tickler"
            Case 5
                MsgBox "Research"
            Case 6
                MsgBox "Privileges"
            Case Else
                MsgBox "Nothing"
                
        End Select
    Thanks for helping

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Tab Control Event
    By Paul H in forum Forms
    Replies: 7
    Last Post: 05-16-2017, 01:35 PM
  2. Mousemove event determine control name
    By dcdimon in forum Programming
    Replies: 3
    Last Post: 07-01-2015, 04:26 PM
  3. Replies: 11
    Last Post: 11-13-2014, 08:52 PM
  4. tab control - firing a page on-click event
    By Chuck55 in forum Programming
    Replies: 7
    Last Post: 05-01-2012, 09:57 AM
  5. User focus control in AfterUpdate event
    By nosliwmada@gmailcom in forum Programming
    Replies: 3
    Last Post: 12-20-2010, 12:51 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums