| re: Keyboard set focus in tabbed subform?
Your tab control should have a Change event.
In that event, you should check whether the value of the tab control is 2.
(This tells you that you have selected the second tab.)
In this case, you can use code like this:
Me.MySubform.SetFocus
Me.MySubform.Form.MyControl.SetFocus
Use your own names for MySubform and MyControl.
HTH
- Turtle
"Steve Miles" <elvl3@hotmail.com> wrote in message
news:b8da910d.0408220702.7febc58d@posting.google.c om...[color=blue]
> I've got a tabbed form with the 2nd tab containing a subform. I'm
> trying to avoid the need to use the mouse to set focus to the first
> field on the subform. I can use <CTRL><TAB> to open the 2nd tab, but
> I can't get the first field to receive focus until I click in it.
> Here's what I've already tried/checked:
>
> 1) I've commented out the "On Current" event VB code.
>
> 2) The first field IS a tab stop and it's first on the tab order.
>
> 3) Using VB code behind various events to set focus to the field.
>
> 4) Find a keystroke sequence that'll set focus to the field.
>
> The weird thing is this .MDB has 3 other forms that are almost exactly
> like the one that doesn't work...and they all work properly.
>
> Any suggestions on how to set focus to a field on a subform off a tab
> on a main form without using the mouse?[/color] |