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!

Starting in subform

Status
Not open for further replies.

damutech

MIS
Joined
Mar 6, 2006
Messages
3
Location
SI
I made a form with subform and when open main form cursor is in the first (tab = 0) field of the main form, but I want that it is in the first field of the new record of subform.

How can I do this?
 
I haven't tested this, but the following might work:

Code:
'In the Main form
Sub Form_Load()
  subform.setfocus
End Sub

This is assuming the first field on the sub-form also has a tab_index = 0.
 
if ddiamond's doesn't suffice, maybe reference the control itself?

Sub Form_Load()
Me!subform.Form!txtName.setfocus
End Sub

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top