MS Access: Set focus on first text box on first tab page and go to next record in Access 2003/XP/2000/97

To do this, you'll need to intervene with VBA code. We'll demonstrate how to do this with an example.

Below we have a form that has a tab control object with 2 tab pages - General and Shipping.



When we tab from the ShipCountry field on the Shipping tab, we want to automatically move to the first field on the General tab (ie: the CustomerID field) and then move to the next record in the fom.



To do this, open your form in design view and select the Properties for the ShipCountry text box. Click on the property called "On Key Down". A button with 3 dots should appear to the right of this property. Click on this button.


When the Choose Builder window appears, highlight Code Builder. Click on the OK button.


This should bring up the Visual Basic editor:

Enter the following code:

If KeyCode = 9 Then
CustomerID.SetFocus
DoCmd.GoToRecord
End If

This code will check if the tab key (KeyCode =9) has been pressed. If the user types the tab key while being on the ShipCountry field on the Shipping tab page, it will automatically set the focus to the CustomerID field on the General tab page.

Then it will move to the next record in the form. So if you started on record #1, it will move to record #2 in the form.