Results 1 to 7 of 7
  1. #1
    Join Date
    Jun 2014
    Posts
    42
    Provided Answers: 1

    Unanswered: Changing a (sub sub) form's record source via tab control

    Hey everyone,

    So I have a form with a navigation control. One of the tabs within the tab navigation has another tabbed navigation form

    I want each of these tabs to have the same form (frmTaskSummary) as their targets, but I want the record source of that form to change based on the tab. For example,

    1. select tab index 0, record source qrySummary0
    2. select tab index 1, record source qrySummary1
    3. select tab index 2, record source qrySummary2
    4. etc.


    Is this possible? Thanks

  2. #2
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    496
    Provided Answers: 24
    Code:
    Private Sub TabCtl1_Change()
    Select Case TabCtl1.Value
       Case 0
          ctl.RowSource = "qrySummary0"
       Case 1
          ctl.RowSource = "qrySummary1"
       Case 2
          ctl.RowSource = "qrySummary2"
    End Select
    End Sub

  3. #3
    Join Date
    Jun 2014
    Posts
    42
    Provided Answers: 1
    Thanks for the response.

    While it looks nice, I don't see an option either on my navigation control bar or on any individual tab or on the form itself for an "On Change" Event.

    When I try to create this by hand in the VBAE, Access literally crashes

    I'm assuming I'm making a simple mistake here, but I'm not quite getting it.

    Also, assuming this works out, what does the "ct1" reference in your code. Is that the navigation subform, the tab itself, something else?

    Thanks again

  4. #4
    Join Date
    Jun 2014
    Posts
    42
    Provided Answers: 1
    I just played around and saw what you are talking about. When I added a "Tab Control" I see an "On Change" event, however, I am using a "Navigation Control" not a "Tab Control." the Navigation control doesn't seem to have this "On Change" feature.

    Is there an alternative method for the navigation control?

  5. #5
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    496
    Provided Answers: 24
    Oh, sorry. I misread. Never found the need to make a navigaion control.

  6. #6
    Join Date
    Jun 2014
    Posts
    42
    Provided Answers: 1
    They're pretty sweet! Really cuts down on your form count... Regardless, thanks for the input.

  7. #7
    Join Date
    Jun 2014
    Posts
    42
    Provided Answers: 1
    Anyone else? Bump...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •