Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I control the tab order with a form that has a subform?

Status
Not open for further replies.

testkitt2

Technical User
Apr 28, 2004
193
US
Hello to all,
I have a small form that right in the middle of the form I insert a subform (related by ss#id). Any way when the form opens the tab order starts at the top and works its way down to the subform. It tabs go once inside the subform but when it reaches the last textbox in the subform it does not move onto the rest of the main form. The property is set to cycle thru "Current Page". To go to the next text box in the main form you have to actually click into the next textbox. Is there a way to tab straight thru the top of main form then thru the subform and finally the rest of the main form?
any help is always appreciated.
JZ

Testkitt2
 
I'm not sure, but offhand, I can think of a somewhat cumbersome workaround, (sounds intriguing, doesn't it?).

Using Screen.ActiveControl & KeyPress Event, you may be able to determine where you are, so that you can set the focus to the next control, yourself.

Private Sub LastControlOnSubform_KeyPress(KeyCode As integer)
If KeyCode = vbTab Or keycode = vbEnter Then

Forms!MainForm!txtAddress.SetFocus
End If

Maybe a little less cumbersome than I thought, and no need for Active control(using this technique).

Hope this offers some options, good luck!

PS, my syntax, & arguments are probably off slightly...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top