Results 1 to 3 of 3
  1. #1
    gmaster is offline Advanced Beginner
    Windows 8 Access 2010 32bit
    Join Date
    May 2014
    Posts
    32

    Tab Control and Recordsource

    Hi, i have a form with a tab control and i need it to change its record source when i click on the label and change the tab.


    Now, i've tryed using VBA's command "Me.RecordSource= " but it only works when i click on the boby of the tab and not on its label...is there a way to do it??

  2. #2
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    In earlier versions of Access, clicking the tab did not do anything. I do not suggest using the Page's click event but when creating a tab control in 2010 and using a tab control in 2010 you can fire code like the following when clicking the Tab Control.

    Code:
    Private Sub tabTest_Click()
    Dim intTab As Integer
    intTab = Me.tabTest.Value
        Select Case intTab
        
        Case 0
            MsgBox "1"
        
        Case 1
            MsgBox "2"
        
        Case 2
            MsgBox "3"
        
        Case Else
            MsgBox "Error"
        
        End Select
    End Sub
    Another option is to use the On Change Event to fire the code. This works on earlier versions as well.

    As for the recordsource thing. I am not aware of the tab control, itself, having a recordsource property.
    Attached Files Attached Files

  3. #3
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    Quote Originally Posted by ItsMe View Post

    ...when creating a tab control in 2010 and using a tab control in 2010 you can fire code like the following when clicking the Tab Control...
    You mean the Boys of Redmond made a change that actually made things better, instead of making things worse? Who'd have thunk it?

    Quote Originally Posted by ItsMe View Post

    ...I am not aware of the tab control, itself, having a recordsource property...
    Me, either! I suspect the OP has a Subform on the Tabbed Page, but we really need a clarification on this.

    Linq ;0)>

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

Similar Threads

  1. RecordSource issue?
    By glen in forum Forms
    Replies: 25
    Last Post: 07-31-2012, 09:34 AM
  2. RecordSource sql stays
    By rashima in forum Forms
    Replies: 0
    Last Post: 04-20-2012, 05:56 AM
  3. RecordSource Error
    By scampbell in forum Programming
    Replies: 7
    Last Post: 11-10-2011, 11:28 AM
  4. Export Recordsource
    By Paul H in forum Reports
    Replies: 2
    Last Post: 10-27-2011, 01:47 PM
  5. RecordSource help
    By mann2x in forum Access
    Replies: 3
    Last Post: 10-05-2010, 06:44 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