By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
426,248 Members | 1,979 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 426,248 IT Pros & Developers. It's quick & easy.

Data Source - Tab Control

P: n/a
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
===
Nov 13 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
"amywolfie" <am*******@verizon.net> wrote in message
news:33**************************@posting.google.c om...
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?


Only if you use subforms.
--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com
Nov 13 '05 #2

P: n/a
am*******@verizon.net (amywolfie) wrote in message news:<33**************************@posting.google. com>...
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
===


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
Nov 13 '05 #3

P: n/a
Thanks very much, Rob.
===
ro***********@dsto.defence.gov.au (Rob Parker) wrote in message news:<ae**************************@posting.google. com>...
am*******@verizon.net (amywolfie) wrote in message news:<33**************************@posting.google. com>...
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
===


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

Nov 13 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.