470,831 Members | 1,464 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,831 developers. It's quick & easy.

Setting focus in a tab control in a nested subform when main form record changes

55
I hope this is an easy question for someone out there. In Access 2000…I have a MainForm with a tab control (MAIN TABS) with 7 tabs.
Within each tab is a SubForm.
Within each SubForm is a tab control (TabCtl0) with 2-6 tabs.
Within each TabCtl0, each tab contains a SubSubForm.

Each record in the MainForm has an ID Number; the SubForms are bound to that ID Number, and the SubSubForms are bound to that ID Number in the SubForms.

In order to speed up opening of the MainForm, I’ve set the record sources for the SubSubForms on the “On Change” event of TabCtl0 in each SubForm.

The problem is that if a user switches to another record in the MainForm while the focus is on one of the SubSubForms that has a record source dependent on a ‘change’ in the tab control, the data for the new record doesn’t show. The user has to click to a different tab, then back to the original one.

I’d like to solve the problem by setting the focus on the first tab when the record changes. (The first tab in each TabCtl0 has a set record source, so its data will update automatically with a new record selection). I found ADezii's How-to article about setting the focus in a tab control. My problem is where to put this SetFocus code – what ‘event’ would it belong to?

Angi
Mar 14 '08 #1
2 2604
PianoMan64
374 Expert 256MB
Angi,

a few questions before I'm able to answer you're question, is all the values in this sub form all in the same table or are they in different tables?

If they are on different tables, what is the realtionship between each table and is there a common key that syncs all of them together?

Let me know,

Email me.

Joe P.
Mar 19 '08 #2
angi35
55
Angi,

a few questions before I'm able to answer you're question, is all the values in this sub form all in the same table or are they in different tables?

If they are on different tables, what is the realtionship between each table and is there a common key that syncs all of them together?

Let me know,

Email me.

Joe P.
All of the SubForms and most of the SubSubForms are on the same table as the main form, but some of the SubSubForms are on other tables and/or queries.

I'm not sure I understand your question about the relationships and the common key. Like I said in my original post, each record in the MainForm has an ID Number; the SubForms are bound to that ID Number, and the SubSubForms are bound to that ID Number in the SubForms.

Only a few of the subforms/subsubs have formal relationships with their master form in the "Relationships" screen. Most of them are just linked in the "link master fields" and "link child fields" properties of the forms.
Mar 20 '08 #3

Post your reply

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

Similar topics

1 post views Thread by John Michael | last post: by
3 posts views Thread by ApexData | last post: by
reply views Thread by mihailmihai484 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.