Data Source - Tab Control

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • amywolfie

    Data Source - Tab Control

    Is it possible to have each page of a Tab Control refer to a different
    table or query?

    In other words, could Page 1 have as its source FORMS and
    Page 2 have as its source qryFORMDATA?

    If so, what's the best way to accomplish this?

    Thanks!

    amy
    ===
  • Rick Brandt

    #2
    Re: Data Source - Tab Control

    "amywolfie" <amywolfie@veri zon.net> wrote in message
    news:33651c5d.0 408101423.29f88 cf2@posting.goo gle.com...[color=blue]
    > Is it possible to have each page of a Tab Control refer to a different
    > table or query?
    >
    > In other words, could Page 1 have as its source FORMS and
    > Page 2 have as its source qryFORMDATA?
    >
    > If so, what's the best way to accomplish this?[/color]

    Only if you use subforms.


    --
    I don't check the Email account attached
    to this message. Send instead to...
    RBrandt at Hunter dot com


    Comment

    • Rob Parker

      #3
      Re: Data Source - Tab Control

      amywolfie@veriz on.net (amywolfie) wrote in message news:<33651c5d. 0408101423.29f8 8cf2@posting.go ogle.com>...[color=blue]
      > Is it possible to have each page of a Tab Control refer to a different
      > table or query?
      >
      > In other words, could Page 1 have as its source FORMS and
      > Page 2 have as its source qryFORMDATA?
      >
      > If so, what's the best way to accomplish this?
      >
      > Thanks!
      >
      > amy
      > ===[/color]

      You can use the Change event of the tab control to run code to change
      the recordsource for the complete form. The tab control's value will
      let you determine which tab you're on, so you can set the appropriate
      recordsource.

      Here's a little bit of sample code that shows which tab you're on:

      Private Sub TabCtl1_Change( )
      Dim strPage As String

      strPage = "... to Page " & TabCtl1.Value + 1 'page index starts at
      0
      MsgBox "Changing page ..." & vbNewLine & strPage, vbOKOnly, ""
      End Sub

      HTH,

      Rob

      Comment

      • amywolfie

        #4
        Re: Data Source - Tab Control

        Thanks very much, Rob.
        ===


        robert.parker@d sto.defence.gov .au (Rob Parker) wrote in message news:<ae9ca459. 0408101949.3595 0f44@posting.go ogle.com>...[color=blue]
        > amywolfie@veriz on.net (amywolfie) wrote in message news:<33651c5d. 0408101423.29f8 8cf2@posting.go ogle.com>...[color=green]
        > > Is it possible to have each page of a Tab Control refer to a different
        > > table or query?
        > >
        > > In other words, could Page 1 have as its source FORMS and
        > > Page 2 have as its source qryFORMDATA?
        > >
        > > If so, what's the best way to accomplish this?
        > >
        > > Thanks!
        > >
        > > amy
        > > ===[/color]
        >
        > You can use the Change event of the tab control to run code to change
        > the recordsource for the complete form. The tab control's value will
        > let you determine which tab you're on, so you can set the appropriate
        > recordsource.
        >
        > Here's a little bit of sample code that shows which tab you're on:
        >
        > Private Sub TabCtl1_Change( )
        > Dim strPage As String
        >
        > strPage = "... to Page " & TabCtl1.Value + 1 'page index starts at
        > 0
        > MsgBox "Changing page ..." & vbNewLine & strPage, vbOKOnly, ""
        > End Sub
        >
        > HTH,
        >
        > Rob[/color]

        Comment

        Working...