Change Tab Without changing focus

D

Doctor

Is is possible to change the active tab of a tab control without using
..setfocus?

Based on what Machine a users selects in a combo box, I want to change the
current tab to reflect the proper machine.

This code is called from several different text boxes in their afterupdate
event. But when I tab out, it sets the focus to the tab instead of to the
next control. I want to change the tab, but then set focus to the next
control.

Thanks in advance.
 
K

Ken Snell

Change the Value of the tab control to the desired tab page's pageindex
value:

Me.TabControl.Value = 3
 
L

Linq Adams via AccessMonster.com

"But when I tab out, it sets the focus to the tab instead of to the next
control. I want to change the tab, but then set focus to the next control."

You don't really need to change the tabbed page, per se, simply set focus to
the first control on the next tabbed page. If, for instance, you're on Page1
and on Page2 you have a textbox named

PageTwoControl

use this code

PageTwoControl.SetFocus

Access will automatically move to Page2 and set focus in the tetxbox named

PageTwoControl
 

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