page control issue

  • Thread starter Thread starter Anthony
  • Start date Start date
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.
 
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
 
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.
 
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
 
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
 
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
 
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
 
Back
Top