Tab Controls in Detail and Footer sections

G

Guest

I have a tab control on a form with four pages. I would like a different
footer for each page. My idea was to place another tab control in the
footer. Is there a way to build a macro or write code that will switch the
page in the footer when the page in the detail section is manually changed?
What I've tried so far has not worked.

Any help would be greatly appreciated!
 
D

Douglas J Steele

The Tab control itself (as opposed to any of the pages in the Tab control)
has a Change event. If you check what value the Tab control has in that
event, you'll know what page was just selected. You can use that fact to
control the footer page.
 
G

Guest

I have seen the On Change property of the Tab Control. It seems like I
should be able to change the focus to a particular page in the footer based
on the pageindex of the detail tab control page; however, I don't see any
values changing in the properties of the tab control when a different page is
selected, so I don't know how to build that event. Maybe I'm just not
looking in the right place. Please keep in mind I am not an expert Access
programmer by any stretch. I can write basic code if necessary.
 
D

Douglas J Steele

Assuming your tab control is named the default TabCtl0, try adding the
following procedure in the On Change event:

Private Sub TabCtl0_Change()

MsgBox Me.TabCtl0

End Sub

Pages are 0 based, so when you click on Page2, you'll get a message box
saying 1, and when you click on Page1, you'll get a message box saying 0.
 
G

Guest

Thanks for all of your help. Once you showed me the msgbox trick I was able
to write a very simple code in the On Change event.
me.TabCtl0 = TabCtl1
docmd.repaintobject
Works great as long as you have the same number of pages on both tab controls!
 

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