Nested Tab Controls - Bring to Front

M

Mike

I have a main tab control with 4 pages and two nested tab controls.
One nested tab control resides on page 2 and the other on page 3. I
have the coding set up so that the nested tab controls are invisible
until you click on the appropriate page. Here is my problem. In the
design mode, I have selected one of the nested tab controls and
clicked Bring to Front. Therefore, it works just fine when I select
that page. However, the other nested tab is blank when I select it.
The only way I can get that one to appear is to go into design mode
and select that one Bring to Front. Then the other one does not show
when I select it.

Any suggestions? I need to have two nested tab controls on this one
tab control.

Thanks.

Mike
 
A

Allen Browne

What version of Access is this that supports nested tab controls?

Do you have subforms on your tab pages, such that the subforms have their
own tab controls?
 
M

Mike

Allen,

I am using Access 2003.

Basically, I have placed a tab control on a page of another tab
control. My issue is that I have done this on two separate pages of
the main tab control. So, I believe the answer to your question is
yes.

Here is the coding which may assist you in what I have done - which
works fine:

Private Sub MainTabCtl_Change()_Change()
If Me.MainTabCtl.Value = 0 Then
ROMSubTab.Visible = False
TreatmentSubTab.Visible = False
Me.Refresh
ElseIf Me.MainTabCtl.Value = 1 Then
ROMSubTab.Visible = True
TreatmentSubTab.Visible = False
ElseIf Me.MainTabCtl.Value = 2 Then
TreatmentSubTab.Visible = True
ROMSubTab.Visible = False
Else
TreatmentSubTab.Visible = False
ROMSubTab.Visible = False
End if
 
D

Dirk Goldgar

Mike said:
Allen,

I am using Access 2003.

Basically, I have placed a tab control on a page of another tab
control. My issue is that I have done this on two separate pages of
the main tab control. So, I believe the answer to your question is
yes.

Here is the coding which may assist you in what I have done - which
works fine:

Private Sub MainTabCtl_Change()_Change()
If Me.MainTabCtl.Value = 0 Then
ROMSubTab.Visible = False
TreatmentSubTab.Visible = False
Me.Refresh
ElseIf Me.MainTabCtl.Value = 1 Then
ROMSubTab.Visible = True
TreatmentSubTab.Visible = False
ElseIf Me.MainTabCtl.Value = 2 Then
TreatmentSubTab.Visible = True
ROMSubTab.Visible = False
Else
TreatmentSubTab.Visible = False
ROMSubTab.Visible = False
End if


The tab controls aren't really nested, but you make them appear so by
showing or hiding them only when the appropriate page of the main tab
control is shown. In principle this should work, and it works for me in a
simple test. The code in the main tab's change event could be simpler:

With Me.MainTabCtl
Me.ROMSubTab.Visible = (.Value = 1)
Me.TreatmentSubTab.Visible = (.Value = 2)
If .Value = 0 Then
Me.Refresh
End If
End With

As I said, this does work for me in a simple test form I just made. I'm not
sure I understand exacty what is happening for you. Clicking Format ->
Bring to Front on the "nested" tab controls doesn't seem to affect the way
my test form works in form view.
 
M

Mike

Dirk,

I have no problem having the controls appear. The issue I'm having is
that the fields on the "sub tabs" don't appear on both of them. Let
me explain. If you go back to your simple test, place two or three
text fields on the ROMSubTab and on the TreatmentSubTab - placing them
on the mainTabCtl pages 1 and 2, respectively in your code example.
Then, open the form and click on the page tab to take you to the
ROMSubTab control. You may or may not see the fields you have placed
there. If I had clicked on the ROMSubTab and did a Bring to Front it
will show. However, if it does show, then when I click on the page
tab to show the TreatmentSubTab the fields will be behind the other
tab control and won't be visible.

I hope that makes sense.
 
D

Dirk Goldgar

Mike said:
Dirk,

I have no problem having the controls appear. The issue I'm having is
that the fields on the "sub tabs" don't appear on both of them. Let
me explain. If you go back to your simple test, place two or three
text fields on the ROMSubTab and on the TreatmentSubTab - placing them
on the mainTabCtl pages 1 and 2, respectively in your code example.
Then, open the form and click on the page tab to take you to the
ROMSubTab control. You may or may not see the fields you have placed
there. If I had clicked on the ROMSubTab and did a Bring to Front it
will show. However, if it does show, then when I click on the page
tab to show the TreatmentSubTab the fields will be behind the other
tab control and won't be visible.

I hope that makes sense.


It makes sense, but it's not what I'm seeing. I put a text box on each tab
control, and as I switched from tab to tab in the main tab control, so that
the pseudo-nested tab controls appeared and disappeared, the text box on
each "nested" tab control was visible as expected.

My guess is that not all your text boxes are actually on the pages of the
tab controls. It's very easy to accidentally put text boxes on the form
*behind* the tab control, or (in this case) maybe on the main tab control's
tab page instead of the tab page of the "nested" tab control.
 
M

Mike

Dirk,

I don't know if you would be interested in looking at this, but I
extracted out the form for you to take a look at. It's at
http://files.axiomllc.com/ It's the only file there. It's called
CM.mdb. If not, I understand.

If so, this is what I want to you take a peek at. Under the tab ROS is
the first sub-tab. I only have fields under ROM-Gen and Eyes. You
can actually see them if you hit your TAB key a bunch of times. Now,
select the Treatment tab, I have fields under Meds and Modalities.
These you can see just fine.

So, I think I have the fields on the right pages - as I can see them
if I hit my TAB key. They are just not visible. If I go into design
mode and select the ROM subtab and bring it to the front then I can
see these fields when I select the tab but the Teratment fields
disappear.

Anyway, I have been struggle with this for hours, so any help is
unbelievably appreciated.

Mike
 
D

Dirk Goldgar

Mike said:
Dirk,

I don't know if you would be interested in looking at this, but I
extracted out the form for you to take a look at. It's at
http://files.axiomllc.com/ It's the only file there. It's called
CM.mdb. If not, I understand.

If so, this is what I want to you take a peek at. Under the tab ROS is
the first sub-tab. I only have fields under ROM-Gen and Eyes. You
can actually see them if you hit your TAB key a bunch of times. Now,
select the Treatment tab, I have fields under Meds and Modalities.
These you can see just fine.

So, I think I have the fields on the right pages - as I can see them
if I hit my TAB key. They are just not visible. If I go into design
mode and select the ROM subtab and bring it to the front then I can
see these fields when I select the tab but the Teratment fields
disappear.

Anyway, I have been struggle with this for hours, so any help is
unbelievably appreciated.


You have boxes "around" -- actually on top of -- the data controls on those
tab pages. Select the boxes and send them to the back.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top