T
tbrogdon
My main form has a tab control which has a subform embedded in
datasheet view.
The main form (frmNewProd) has a combo box (cboShift). I want to make
a selection in the combo box, hit <enter> and set the focus to the
first field (WorkstationID) of the first record in the empty subform
(sfmProdOp) which is embedded in the tab control (tabProdDetails).
I have tried attaching the following code to the AfterUpdate event of
the combo box on the main form:
Private Sub cboShift_AfterUpdate()
Me!sfmProdOp.SetFocus
Me!sfmProdOp.Form!WorkstationID.SetFocus
End Sub
but it doesn't go there. I don't actually know where the focus goes. I
want to move to the first field via hitting the <enter> key.
Currently, if I hit enter all that happens is that my form scrolls up
making the top of the form disappear and the cursor does not reappear.
I think the focus is being set to the tab control - I think. On the
other hand, if I hit the <tab> key twice the cursor appears in the
appropriate field. But of course, I don't want to use the <tab> key.
TIA,
Tim
datasheet view.
The main form (frmNewProd) has a combo box (cboShift). I want to make
a selection in the combo box, hit <enter> and set the focus to the
first field (WorkstationID) of the first record in the empty subform
(sfmProdOp) which is embedded in the tab control (tabProdDetails).
I have tried attaching the following code to the AfterUpdate event of
the combo box on the main form:
Private Sub cboShift_AfterUpdate()
Me!sfmProdOp.SetFocus
Me!sfmProdOp.Form!WorkstationID.SetFocus
End Sub
but it doesn't go there. I don't actually know where the focus goes. I
want to move to the first field via hitting the <enter> key.
Currently, if I hit enter all that happens is that my form scrolls up
making the top of the form disappear and the cursor does not reappear.
I think the focus is being set to the tab control - I think. On the
other hand, if I hit the <tab> key twice the cursor appears in the
appropriate field. But of course, I don't want to use the <tab> key.
TIA,
Tim