Tab control issue

gblack

Registered User.
Local time
Today, 05:27
Joined
Sep 18, 2002
Messages
632
UGH!

I have been developing a tab control. Up to this point everything has been working fine. But now, for some strange reason the click event for a certain tab control is firing improperly. Meaning: whenever I click on a specific tab, the tab control pulls up the wrong page/tab... Meaning when I click on page 2 page 3 appears.

I can get the click even to work properly, but only if I click diectly on page 3; this highlights the page caption (i.e., you can see the little box around the caption) and at this point when I click page 2 tab, the correct page appears.

What the heck is going on here?

I have fiddled with the page order, thinking that it was a proximity issue, but it doesn't matter where I put page 3 (even if I place it at the end of the tab control and make it page 6) it will pop up when I click page 2.

Has anyone ever dealt with this before, or know how I can remedy the situation?
 
Solution:

I found that the reason this was happening had to do with tab order (i.e. within "page2" of the table control).

I was attempting to move a control from page 2 to a different page; this control was previous set as the first position in my tab order on said page.

Seemingly, the reason for the page debacle, stems from the fact that when you click on a tab in your tab control, access is looking for the first control on that page to setfocus to... If it can't find it, Access gets very mad at you, dances the funky chicken, sticks its tongue out, and yells Nany-nany-boo-boo... until you set things straight again.

The solution for this is: Before moving (or deleting) any controls off a given page of a tab control, make sure you first reset the tab order within said page, making sure that the control you wish to move (or delete) isn't in the first tab position within said page.

Side note: also resetting properties of a control (set as your first tab within a given page) that would negate a tab order (.visible = false, tab stop = no, .enabled = false etc.), seemingly causes this problem as well.

Hope this helps someone from not pulling their hair out like I did.

GL,
Gary
 
Last edited:
That's pretty interesting...I would have never guessed. Thanks for sharing the solution with us.
 

Users who are viewing this thread

Back
Top Bottom