Using tab to go to subform (1 Viewer)

danikuper

Registered User.
Local time
Today, 09:15
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!

:)
 

JKpeus

Registered User.
Local time
Today, 09:15
Joined
May 8, 2003
Messages
13
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
 

danikuper

Registered User.
Local time
Today, 09:15
Joined
Feb 6, 2003
Messages
147
Great!!!

Thanks a lot.
 

Users who are viewing this thread

Top Bottom