Tab control

W

wd1153

Hi

is there anyway to make certain page on a tab control as
the active one programmatically in VBA? Thanks in advance.
 
M

MacDermott

Set the value of the tab control to the index of the page you want to
activate.

HTH
- Turtle
 
M

Marshall Barton

wd1153 said:
is there anyway to make certain page on a tab control as
the active one programmatically in VBA? Thanks in advance.


Me.tabCtl.Pages(pagenumber).Controls(0).SetFocus

You can set the focus to any control on the page if you
don't want to use the first control.
 
M

Marshall Barton

MacDermott said:
Set the value of the tab control to the index of the page you want to
activate.


Good point Turtle. Just to double check I tried
Me.tabCtl = 1
and got an error message. So I tried
Me.tabCtl.Value = 1
and it worked just fine. That's certainly more
straightforward to use when you don't care what control has
the focus.
 

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