page control issue

A

Anthony

When does the 'On Click' event fire when a page tab is clicked? I put

MsgBox "click event"

in the 'On click' event, of all pages in my page control, and when I click
each tab, nothing happens.
 
S

Steve C

Hi Anthony,

The on_click event of a tab control is for the most part useless. Use the
tab's on_change event

HTH
Steve
 
A

Anthony

Steve,


When I use the on_change event of the tab control, how do I return the value
of the selected page name?

Something like

Private Sub MyTab_OnChage()

MsgBox MyTab.SelectedPage.Name

End Sub

I know there's no such thing as "SelectedPage", but I tried numerous things
with the "pages" property, and couldn't get it do to what I want.
 
S

Steve C

Anthony said:
Steve,


When I use the on_change event of the tab control, how do I return the
value of the selected page name?

Something like

Private Sub MyTab_OnChage()

MsgBox MyTab.SelectedPage.Name

End Sub

I know there's no such thing as "SelectedPage", but I tried numerous
things with the "pages" property, and couldn't get it do to what I want.

The value of the tabcontrol itself will tell you the pageindex of the
current page selected.

MsgBox MyTab

The index is 0 based. A return value of 1 is the second page of the control.
If you need the page names you will need to determine that from the index,
AFAIK.

HTH
Steve C
 
A

Anthony

much thanks!

Steve C said:
The value of the tabcontrol itself will tell you the pageindex of the
current page selected.

MsgBox MyTab

The index is 0 based. A return value of 1 is the second page of the
control. If you need the page names you will need to determine that from
the index, AFAIK.

HTH
Steve C
 
D

Dirk Goldgar

Steve C said:
The value of the tabcontrol itself will tell you the pageindex of the
current page selected.

MsgBox MyTab

The index is 0 based. A return value of 1 is the second page of the
control. If you need the page names you will need to determine that
from the index, AFAIK.

E.g,

MsgBox "Page " & Me!MyTab.Pages(Me!MyTab).Name
 
K

Kelii

Anthony,

Every page in a tab control has an associated value, generally
beginning wtih zero. To obtain that value you can use the following:

NameOfTabControl.Value

This will return a value of 0,1,2,3 etc...

Kelii
 

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