Using tab to go to subform

danikuper

Registered User.
Local time
Today, 14:59
Joined
Feb 6, 2003
Messages
147
I have a main form and a subform. In both I have the tab order arranged as I want.

question: how can I go to the subform after I have tabbed through all my fields in my main form? When I reach the last field, Access brings me to a new (or next) record.

I'm using Access 2000.

Thanks!

:)
 
Add this code to the last field in your main form (in the KeyDown event):

Code:
Private Sub lastFieldInYourMainForm_KeyDown(KeyCode As Integer, Shift As Integer)
    If KeyCode = 9 Then
        Me.subfrmName.SetFocus
    End If
End Sub
KeyCode 9 = the tab key
Change subfrmName to the name of your subForm.
You should also change the Cycle property of your main form to "Current Record"


HTH,
Jason
 
Great!!!

Thanks a lot.
 

Users who are viewing this thread

Back
Top Bottom