Subforms on tab controls that are on tab controls (1 Viewer)

CanuckBuck

Registered User.
Local time
Today, 00:37
Joined
Apr 27, 2019
Messages
31
I have a scenario where I want to have a form that has a header with some information that is supplied from another form and then the details portion of the form having a tab control with two tabs. The first tab has a number of controls bound to the table that is the record source for the form. This tab also has a number of tab controls on it, each with sub-forms (that have a 1:m, child relationship to the main form) on them.

The 2nd tab of the main form's tab control also has a sub-form on it.

With this configuration, the sub-forms on the tab controls of the first tab of the main form show up on the 2nd tab of the main form.

Does anyone know why this is happening and how I can prevent it?
 

Attachments

  • Main tab.jpg
    Main tab.jpg
    201.1 KB · Views: 562
  • second tab.jpg
    second tab.jpg
    102.6 KB · Views: 396

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 07:37
Joined
Jul 9, 2003
Messages
16,280
If you copied and pasted them from somewhere else, then it is quite common for the controls to drop straight through the Tab control and actually be on the form underneath check for that...
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 01:37
Joined
Feb 28, 2001
Messages
27,167
I'm going to guess that somehow the sub-form control is anchored in the wrong place. However, you should also remember that all controls on a form are simultaneously visible to code regardless of being on a tab or not.

EDIT: Uncle Gizmo and I said essentially the same thing except he named the "wrong place."
 

CanuckBuck

Registered User.
Local time
Today, 00:37
Joined
Apr 27, 2019
Messages
31
If you copied and pasted them from somewhere else, then it is quite common for the controls to drop straight through the Tab control and actually be on the form underneath check for that...
I checked that. I removed the tab control that contained the subform that was "bleeding through" to the 2nd tab of the main form. I put the tab control on the 1st tab of the main form again. It doesn't bleed through to the 2nd tab. I put a subform control on the newly placed "child" tab. It doesn't bleed through. When I define the source object for the subform the form that is displayed bleeds through to the 2nd tab of the main part of the form (see the screenshots provided previously). Is that the right process - am I missing something or doing something wrong?

I'll note, in the case that it matters, I'm using Access 2019.
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 23:37
Joined
Oct 29, 2018
Messages
21,467
Wait a minute... I thought you can't insert a Tab Control inside a Tab Control. How did you do that? Is that something new in 2019? Can you post a sample copy of your db with test data? Just curious... Thanks!
 

CanuckBuck

Registered User.
Local time
Today, 00:37
Joined
Apr 27, 2019
Messages
31
I just made an interesting discovery. When I place the subform directly on the Main tab it doesn't bleed through to the 2nd tab. However, when I put the subform on a tab control that's on the main tab then it does bleed through.
 

CanuckBuck

Registered User.
Local time
Today, 00:37
Joined
Apr 27, 2019
Messages
31
Wait a minute... I thought you can't insert a Tab Control inside a Tab Control. How did you do that? Is that something new in 2019? Can you post a sample copy of your db with test data? Just curious... Thanks!

Unfortunately my database is SQL Server so packaging up a copy of the Access DB will be problematic. I'll see if I can quickly whip up an MS Access based version to demonstrate it.
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 23:37
Joined
Oct 29, 2018
Messages
21,467
Unfortunately my database is SQL Server so packaging up a copy of the Access DB will be problematic. I'll see if I can quickly whip up an MS Access based version to demonstrate it.
That would be appreciated. I was merely curious to see a tab control inside another tab control. Unless I was thinking of something else, I can't remember that was doable in earlier versions of Access. Cheers!
 

CanuckBuck

Registered User.
Local time
Today, 00:37
Joined
Apr 27, 2019
Messages
31
That would be appreciated. I was merely curious to see a tab control inside another tab control. Unless I was thinking of something else, I can't remember that was doable in earlier versions of Access. Cheers!
Well, That wasn't too hard. I just converted all of the tables to local tables. Take a look at the form called NAS 02 Review Header (copy). You'll see that There's a "main" tab control that covers most of the detail section of the form. It has two tabs. On the first tab there are several tab controls. My problem is that the subform on the tab control called "Reviewers". Shows up on the 2nd tab of the "main" tab control.
 

Attachments

  • Database3 - Copy.zip
    2.8 MB · Views: 430

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 23:37
Joined
Oct 29, 2018
Messages
21,467
Well, That wasn't too hard. I just converted all of the tables to local tables. Take a look at the form called NAS 02 Review Header (copy). You'll see that There's a "main" tab control that covers most of the detail section of the form. It has two tabs. On the first tab there are several tab controls. My problem is that the subform on the tab control called "Reviewers". Shows up on the 2nd tab of the "main" tab control.
Thanks. I'll take a look when I get back in front of a computer.

Sent from phone...
 

MajP

You've got your good things, and you've got mine.
Local time
Today, 02:37
Joined
May 21, 2018
Messages
8,527
I do not see it. I only see the subform sfAuthComments on the second tab.

page2.jpg
 

diri

New member
Local time
Today, 08:37
Joined
Feb 1, 2020
Messages
1
I can confirm such behaviour of Acc2016 in some way.

It looks like being dependant on specific combinations of Windows updates and Office updates but, I could never find a direct relation. Sometimes it happens using different machines, sometimes not.

Another "mysterium" are kind of vanishing forms (they switch to background automatically) when opening a new form from the form (ie to edit details). Happens with some forms, not with all forms while using same code.

Remark:
To keep user at workflow I avoid using tabbed interface at Access and use tabs on forms only to have "secondary" data visible.

cu, diri
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 07:37
Joined
Jul 9, 2003
Messages
16,280
If you copied and pasted them from somewhere else, then it is quite common for the controls to drop straight through the Tab control and actually be on the form underneath check for that...

In this YouTube video at time index 1-minute 16 seconds I demonstrate the issue I was explaining in this Video. It is often difficult to place controls correctly on a tab page, and in particular, sub-form/subreport controls. This is a video of the technique I employ, which is basically keeping the property sheet open so you know what you are doing!

Pagination - Nifty Access​

 
Last edited:

missinglinq

AWF VIP
Local time
Today, 02:37
Joined
Jun 20, 2003
Messages
6,423
You are correct theDBguy...at least thru v2007. I found this workaround in an ancient file in my archives:

The workaround for this is to create two forms.

On FormA have your original tabbed control.

On FormB place a tabbed control. This will be the tabbed control within a tabbed control.

Now, go back to FormA and place a subform on the desired tabbed page. When the Subform wizard comes up, select FormB as the form to use.

It's not an elegant solution, but with some formatting of FormB you can probably get it to look like you want!

Linq ;0)>
 

Users who are viewing this thread

Top Bottom