Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Different Control Source for each tab of a tab control? 1

Status
Not open for further replies.

NCYankee1

Programmer
Mar 27, 2001
66
0
0
US
Hi

I have a form with Control Source set to TBL1. On the form is a tab control with 4 tabs. Tab1 will contain fields from TBL1. But the other tabs will contain related data from other tables. Like tab2 will contain fields from TBL2 (related to the row showing on tab1 from TBL1), etc. Is there a way I can change the control source when each tab is poked?

Thanks!
 
You need to use subforms. These forms can be linked to the main form or act independently of each other. Do a search in the help menu for 'subforms', then if you have more questions, post them here. Mike Rohde
rohdem@marshallengines.com
 
Dear Mike:
I'm developing a form with a tab control as well. Is there a disadvantage to basing the whole form on one query, even though there may be many, many fields? I have four tabs with the data on each tab related to one record in one table.
Thanks for your advice.
:) Gus Brunston
An old PICKer
padregus@home.com
 
If your database is small and/or you are satisfied with the performance, I wouldn't mess with it.

An interesting alternative to a tab control is to place a series of buttons across the top of a single subform. As the user clicks the buttons, you change the recordsource (and the linking fields if necessary) of the subform. This means that Access only runs one query at a time as the user requests the data rather than all the queries when the form and tab control are loaded.

However, if one of your queries for a subform is very large, this alternative can annoy the user in a hurry because he/she has to wait for that query to load each time he/she clicks the button. Mike Rohde
rohdem@marshallengines.com
 
Thanks for the tips, Mike.
:) Gus Brunston
An old PICKer
padregus@home.com
 
NCYankee1
I think you should do something like this...
1] Let your Main form have some recordsource say table 1
2] Put a Tab control with 4 pages on the main form.
3] On Each page of the tab control place a Subform and link it to the key you want it to match with the key on the main form. Set its own recordsouce
4] Do this on each page, i.e. on each page put a subform with its own recordsource..

this works for me so far...

-Manish
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top