Tab Control in a Tab Control

J

John Smith

This answer to this question is probably no...but I am still a newbie.

In Access 2002 can you insert a tab control within another tab
control?

i.e. - I would like to have a form w/ three tabs Clients, Workers,
Reports and be able to have a separate tabbed control in the Clients
section.

Any suggestions?

-john smith
 
R

Rick Brandt

John Smith said:
This answer to this question is probably no...but I am still a newbie.

In Access 2002 can you insert a tab control within another tab
control?

i.e. - I would like to have a form w/ three tabs Clients, Workers,
Reports and be able to have a separate tabbed control in the Clients
section.

The simplest way to do it is to embed a subform on the Clients TabPage and put
another TabControl on the subform. If you need controls on both forms bound to
the same table though this can be problematic.

As an alternative you can have a second TabControl that sits in front of the
first one and use the Change event of the first one to hide the second except
for when the Clients TabPage is selected. When in normal view this will provide
the look of a TabControl within another TabControl, but can be a bit of a pain
while in design view since the second TabControl is always there blocking your
view of the other pages on the first TabControl. If you don't mind temporarily
moving it out of the way while in design view that can work pretty well.
 
J

John Smith

Thanks for the advice. I like the idea of the second option:
As an alternative you can have a second TabControl that sits in front of the
first one and use the Change event of the first one to hide the second except
for when the Clients TabPage is selected.

Being a newbie, though, what would the Change event code be and which
button/subform would it be attached to?

-john smith
 
R

Rick Brandt

John Smith said:
Thanks for the advice. I like the idea of the second option:


Being a newbie, though, what would the Change event code be and which
button/subform would it be attached to?

-john smith

I'm talking about the Change event of the first TabControl. This fires
whenever you change the current tab page being viewed. In that event you
would have code similar to the following to show the second TabControl only
when the first page of the first TabControl was selected...

Select Case Me.FirstTabControlName.Value
Case 0
Me.SecondTabControlName.Visible = True
Case Else
Me.SecondTabControlName.Visible = False
End Select

The TabPage index values start with zero so when the value of the
TabControl = 0 then you are on page one of the control.
 

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