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

tab controls: is using them for separate fields of one record appropriate?

P: 24
Hello,

I want to separate three different groups of fields from one record. Originally I was going to add a button on a form to "drill-down" to more detail is the user wanted to see it. I relatively new at Access and VBA but have other IT experience.

I stumbled upon the tab control that gives a very nice tabbed look that people intuitively know how to use. I went ahead and created three nice-looking subforms and then assembled them into a tabbed form with three tabs. Then I realized that if I scrolled through the records to a certain one and then clicked on one of the other two tabs, the record was not "synched" with the one I was on in the original tab.

Is it possible to make this work somehow? Or am I "perverting" the use of this control? I have a 1:1 relationship between all three tabs (subforms) as they are parts of the same record. If it is possible, could someone please give me an idea on what to do? I've been sweating this for hours and hours and googling and reading but I'm lost.

Thanks in advance for any help and your time in reading this!
Dec 19 '06 #1
Share this Question
Share on Google+
5 Replies


MMcCarthy
Expert Mod 10K+
P: 14,534
Hello,

I want to separate three different groups of fields from one record. Originally I was going to add a button on a form to "drill-down" to more detail is the user wanted to see it. I relatively new at Access and VBA but have other IT experience.

I stumbled upon the tab control that gives a very nice tabbed look that people intuitively know how to use. I went ahead and created three nice-looking subforms and then assembled them into a tabbed form with three tabs. Then I realized that if I scrolled through the records to a certain one and then clicked on one of the other two tabs, the record was not "synched" with the one I was on in the original tab.

Is it possible to make this work somehow? Or am I "perverting" the use of this control? I have a 1:1 relationship between all three tabs (subforms) as they are parts of the same record. If it is possible, could someone please give me an idea on what to do? I've been sweating this for hours and hours and googling and reading but I'm lost.

Thanks in advance for any help and your time in reading this!
Your subforms have to be tied to the main form by a unique field. Set the record source of the main form to a table or query containing the uniqueID/primary key that is common on all subforms and put a control on the mainform to represent this field. You can set it to invisible if you don't want the user to see it.

Now set the master child properties of each subform object to match the field above.

Mary
Dec 19 '06 #2

missinglinq
Expert 2.5K+
P: 3,532
Mary's advice is correct as far as setting up subforms, but you're needlessly complicating things by using subforms to display parts of the same record! The tabbed pages of a form are simply "extensions" of the form, if you will. They are referenced exactly the same as if they were on a "one screen" form, unlike controls on subforms. Tabbed controls are the perfect answer to logically grouping data from a single record!

What you are referring to as "fields" are actually controls. In Access fields are parts of tables not forms. Simply sort your controls into logical groups and place each group on a different tabbed page (tab control) and you're done! Clicking from one tab to the next, you will always be on the same record!
Dec 19 '06 #3

MMcCarthy
Expert Mod 10K+
P: 14,534
Great work Linq

I misread the original question and thought the subforms were there for a reason.

Mary
Dec 19 '06 #4

P: 24
Thanks Mary and missinglinq for your speedy and useful answers. Missinglinq, I did what you suggested and it worked perfectly. Mary, I will use what you advised when I have a relationship between tables. I was even wondering if I had to do a self-join for the tabbed controls but it turns out that indeed, I don't need subforms. Just plopped the controls on the various tab pages and they all show the same record.

thanks again!!
Dec 19 '06 #5

missinglinq
Expert 2.5K+
P: 3,532
Glad we could help!
Dec 19 '06 #6

Post your reply

Sign in to post your reply or Sign up for a free account.