PDA

View Full Version : Using Tab Control Box



akn112
10-22-2007, 08:26 AM
Hi all,

Im now exploring the usage of tab controls for my reporting form. I'm quite new in the area and find the tab control has some weaknesses and i'm not sure if there's anyway around this. This is my current understanding of how the tabcontrol works:

1) All forms within all tabs load at the same time when u initially load the tab control box and no time afterwards
2) There is no way to control events that occur when u change to a certain tab.

What i was wondering is if u can:

1) Decide when each form is loaded ( ie: load page 1 when i click tab 1)
2) Create code under the event a tab is changed
3) Any other hints or tips that might help

Thanks all!

OBP
10-22-2007, 09:17 AM
I have used tabs a few times and I have found the best place for VBA is in the Sub Form's "Got Focus", or on the Sub Form's first Field's Got focus event.

akn112
10-22-2007, 09:52 AM
thanks OBP, i'll keep that in mind as that's what i needed for the particular tab loading. Another problem is the initial load of the tab control. It takes quite a while (since its loading all tabs at once) is there anyway around this?

alimcpill
10-22-2007, 10:21 AM
2) There is no way to control events that occur when u change to a certain tab.


I'm almost 100% certain you can capture that, in the TabControl_Change() event. Once it fires, check the TabControl.Value property. It should be an index number starting at 0 telling you which tab is currently selected.

OBP
10-22-2007, 12:19 PM
How many Tabs have you got?

akn112
10-23-2007, 12:07 PM
i've only got 2, but they're quite large, each of them have to load a listbox

OBP
10-23-2007, 04:17 PM
akn, it should not take any time to load the tabs.
Have they background photos or something?
Can you post a zipped copy less data?