Tabs - controls showing on all tabs (1 Viewer)

ajb_1976

Registered User.
Local time
Today, 17:16
Joined
Feb 25, 2005
Messages
34
Hello,

I am using access 2007 and have a basic form with a tab control with 2 tabs. My problem is that some of the labels I have created on tab 1 are showing on tab 2 and I cannot see how to stop this!
What do i need to do to keep controls i create on one tab from being displayed on all the tabs?

Many Thanks,
Alan
 

gemma-the-husky

Super Moderator
Staff member
Local time
Today, 17:16
Joined
Sep 12, 2006
Messages
15,658
the conrols are no the form, rather than on a tab, so you are seeing them all the while

cut them, select a tab, and paste again. you will have ot reset any event handlers on these controls after doing this.
 

missinglinq

AWF VIP
Local time
Today, 12:16
Joined
Jun 20, 2003
Messages
6,423
Dave (Male!) is correct. Here's a quick little tutorial I give people on the use of Tabbed Pages. It addresses some of the common problems experienced with them:

First thing to remember is that the Tabbed Pages are all part of a single form; think of it as a really long form turned on its side. Because it is all one form, all referencing to any control on it is done in the same manner as if they were all on one single screen. Create a form in Design View. Goto the toolbox and click on the Tabbed Control icon; it actually looks like several manila file folders. Place it on your form and adjust the size to your liking. If you need more than the two tabbed pages it initially gives you, click on the tabbed control to select it. Goto Insert and click on Tabbed Control Page and another tabbed page will be added. Do this as many times as necessary.

This is the really important part: when you go to add a control to a tabbed page, whether it be a textbox, command button or subform, you must first click to select one of the pages, then add the control. Otherwise, the control will be added to the form itself, and will show thru on all tabbed pages! If a single page has been selected, when your cursor carrying the control appears over the page, a black "insert" will appear.

Once you have the form's Control Source (your table or a query) set up, you simple add controls as you normally would, heeding the above paragraph.

Also important to understand! If you go to move a control from one part of your main form to a tabbed page, you cannot drag and drop it! You must cut it, select the tabbed page, then paste it! And if the control has any code behind it, a GotFocus, OnClick, etc, after dropping it on the tabbed page, you'll have to "re-connect" it to its code. Select the control, goto Properties, click to the right of [Event Procedure] on whatever event to bring up the ellipsis (...) then click it to go to the code window. Exit the code editor and the control and its event code will be connected.

One last thing. When trying to access the Properties of the Tabbed Control, such as the BackStyle, people complain that they can't find property. The problem is that they haven't selected the Tabbed Control, they've selected one of the pages of the Tabbed Control! The best way to be sure of selecting the Tabbed Control itself is to click to the right of the last tab. If you have 2 tabs, for instance, click in the blank area where Tab 3 would be, if you had a Tab 3.
 

dave1234aust

New member
Local time
Tomorrow, 02:16
Joined
Sep 1, 2016
Messages
4
Once again Missinglinq I get to thank you for sorting out another issue.

This was driving me mad, but once you explained how the tabbed form is all part of one form and to use the select then cut and paste it made sense (and worked)

And proves the search function in the forums works a treat :)

Dave
 

missinglinq

AWF VIP
Local time
Today, 12:16
Joined
Jun 20, 2003
Messages
6,423
It's always particularly satisfying, to me, when an old post helps a new seeker of help! It's also satisfying to see someone use the search function, rather than simply starting a new thread, often on a subject that as been covered a gazillion times before!

Glad we could help and good luck with your project, Dave!

Linq ;0)>
 

aivars

New member
Local time
Today, 19:16
Joined
May 23, 2015
Messages
15
Yes, indeed! Was going nuts for a couple of hours. Thank you.
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 12:16
Joined
Feb 19, 2002
Messages
43,296
You also get a visual clue when you are doing this correctly because the tab form turns black. If it doesn't, you are probably dropping the control on the main form and will see it on all tabs.
 

Users who are viewing this thread

Top Bottom