Tab Control: Keeping Track Of Which Page User Selected?

P

PeteCresswell

Got a tab control with five tabs on it.

Also have a TreeView.

As the user walks the TreeView, different tabs get made visible/
invisible/selected depending on the type of node selected.

What I want to do is keep track of the fact that the user has
explicitly chosen to see a certain page - let's call it "Allocations".

Change() doesn't work bc it fires on it's own when the VBA code sets a
value.

Click() doesn't seem to fire at all when the user clicks the tab.

MouseOver() works - but not reliably. For one tab, it's pretty much
100%, but for another it's 30% at most.

Are there any hidden events for a TabControl that I might use?

Some other approach?
 
J

Jeanette Cunningham

Hi Pete,
the value of the tab control is the page that is currently selected.
If you have a tab control called tabParts, then if tabParts = 0 then you
know user is on the first page, if tabParts = 2 then you know user is on the
3rd page.


Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
 
P

(PeteCresswell)

Per Jeanette Cunningham:
the value of the tab control is the page that is currently selected.
If you have a tab control called tabParts, then if tabParts = 0 then you
know user is on the first page, if tabParts = 2 then you know user is on the
3rd page.

But I'm resetting .Value as the user walks the TreeView.

Different nodes logically require that different tabs be made
visible/invisible and, sometimes, selected automatically.

In this case, once the user explicitly clicks the "Allocations"
tab, I want to make note of that and when they walk the TreeView
to another security's node where it's possible to load the
"Allocations" I want it automatically selected - as opposed to
having the security's info tab selected.

OTOH, once they explicitly the security info tab, I want the
reverse tb happening.
 
J

Jeanette Cunningham

Not sure if there's any way to get the page of the tab control the user just
clicked other than using the value of the tab control.
Maybe you need to store the value of the tab control each time the user
changes it so you can go back and check if the previous tab they clicked was
the Allocations tab.
I haven't used tab controls with a tree view. There maybe someone who has
done that and can offer more specific help.


Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
 

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