Tab Order - Subform

  • Thread starter Thread starter doodle
  • Start date Start date
D

doodle

Windows xp, access 97

I have a main form with multiple subforms and am attempting to control
the tab order in the main form while the user goes between subforms.
The use will be going from one combo box to another but the second
combo box is actually a subform. I have used this code before and am
not sure why it isn't working.

This is the code on the first combo box:

Private Sub RepairTech_Exit(Cancel As Integer)

Forms!frmJL_DataEntry.sbfmJL_OrderNum.Form.txtOrderNum.SetFocus

End Sub

when the code runs, focus does not change. any help would be greatly
appreciated.

-doodle
 
Windows xp, access 97

I have a main form with multiple subforms and am attempting to control
the tab order in the main form while the user goes between subforms.
The use will be going from one combo box to another but the second
combo box is actually a subform. I have used this code before and am
not sure why it isn't working.

This is the code on the first combo box:

Private Sub RepairTech_Exit(Cancel As Integer)

Forms!frmJL_DataEntry.sbfmJL_OrderNum.Form.txtOrderNum.SetFocus

End Sub

when the code runs, focus does not change. any help would be greatly
appreciated.

-doodle

I believe you need to set focus *twice* - once to the Subform control,
and then to the combo box on that form. Try

Forms!frmJL_DataEntry.sbfmJL_OrderNum.SetFocus
Forms!frmJL_DataEntry.sbfmJL_OrderNum.Form.txtOrderNum.SetFocus

John W. Vinson[MVP]
 

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

Back
Top