Change focus off tab controls

G

Guest

Using Office 2003 and Windows XP;

I have several tabs on tab control on a main form.
When the user clicks each tab, I want focus to go to a text box on the main
part of the form (i.e. off the tab control altogether). I set focus in the
usual way:

Me.MyMainFormControl.SetFocus

But, this only works on the first tab; for all others, focus remains in one
of the controls on the tab. How can I make this behave?

Thanks much in advance.
 
R

ruralguy via AccessMonster.com

Put your code in the TabCtl Change event.
Using Office 2003 and Windows XP;

I have several tabs on tab control on a main form.
When the user clicks each tab, I want focus to go to a text box on the main
part of the form (i.e. off the tab control altogether). I set focus in the
usual way:

Me.MyMainFormControl.SetFocus

But, this only works on the first tab; for all others, focus remains in one
of the controls on the tab. How can I make this behave?

Thanks much in advance.
 
R

ruralguy via AccessMonster.com

I just tried it on a tab control form I have and it works just as I would
expect. Are you doing anything else in the Change event? I was, so I put it
as the last instruction before the exit sub.
Hi,

It already is in the tab control change event...any other ideas?
Put your code in the TabCtl Change event.
[quoted text clipped - 11 lines]
 

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