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

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

P: 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
Share this Question
Share on Google+
2 Replies


Expert 100+
P: 374
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

P: 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.