Lesson 7.5. Changing the Tab Order
Figure 7-9. The tab order determines the order by which you advance from one field to the next when you press Tab.
Figure 7-10. Even when you reposition fields on a form, the tab order remains the same.
Figure 7-11. Changing the tab order.
If you add, remove, or move fields on a form, you'll want to change the form's tab order. A form's tab order determines the order in which you advance from one field to the next when you press the Tab key. When a form is first created, the order of the fields determines the initial tab order. Even when you reposition the fields on a form, the form's tab order remains the same. For example, the tab order shown in Figure 7-9 is from when the form was originally created. Because you have rearranged several controls, the tab order no longer reflects the order in which the fields appear on the form, as shown in Figure 7-10. This isn't really a big problem, since it's easy to change the tab order.
To change the tab order for a form select View Tab Order from the menu. The will appear, as shown in Figure 7-9. From here all you have to do is click and drag the field in the order you want. Or you can click the Auto Order button, which automatically rearranges the tab order to correspond with the order in which controls appear on the form.
Make sure that you have the frmFirstForm form open.
First let's see the current tab order of the frmFirstForm form.
Switch to Form view by clicking the View button on the .
Go to the next step and see what happens when you try tabbing through the fields on the form.
Press the Tab key several times.
When you press the Tab key, the cursor jumps from the CustomerID field to the LastName field to the... Phone field? The tab order for the frmFirstForm form was determined when the form was created. You may have moved the Phone name field in the previous lesson, but its position in the tab order hasn't changed.
You can view and change the tab order by opening the Tab Order dialog box. First you need to be in Design view.
Click the View button on the Form Design toolbar to switch to Design view.
Here's how to display the Tab Order dialog box.
Select View The Tab Order dialog box appears, as shown in Figure 7-9. The order of the fields in the list is the order in which you will advance from one field to the next when you press the Tab key. There are a couple of ways to change the tab order. The fast and easy way is to click the Auto Order button, which automatically rearranges the tab order to correspond with the order in which controls appear on the form.
Note: The initial tab order of a form and the Auto Order option both create a tab order from left to right, top to bottom.
Click the Auto Order button.
Access looks at the order in which fields appear on the form and adjusts the tab order accordingly.
Sometimes the tab order may not be intuitive for data entry and you may want to manually change it. For example, you may want to modify the tab order so that the address, city, state, and Zip Code fields are together. Here's how to manually change a field's position in the tab order.
Click the City row selector in the Custom Order list.
Now that you have selected the City row you can change its order by dragging it to a new location in the list.
Drag the City row until it is below the Address row, as shown in Figure 7-11, then release the mouse button.
Move on to the next step and finish arranging the fields in the tab order.
Drag the State row below the City row and drag the ZipCode row below the State row.
You're finished changing the tab order for the frmFirstForm form.
Click OK to close the Tab Order dialog box.
Let's test the new tab order.
Switch to Form View by clicking the View button on the Form Design toolbar. Press the Tab key several times and notice the order in which the cursor moves from field to field.
You've finished this lesson so...
Save your changes and then close the frmFirstForm form.
TO CHANGE A FORM'S TAB ORDER:
DISPLAY THE FORM IN DESIGN VIEW.
CLICK THE ROW SELECTOR FOR THE CONTROL YOU WANT TO MOVE.
CLICK AND DRAG THE ROW SELECTOR TO THE DESIRED LOCATION.
REPEAT STEPS 3 AND 4 TO CHANGE THE ORDER OF ADDITIONAL CONTROLS.
TO AUTOMATICALLY CHANGE THE TAB ORDER:
DISPLAY THE FORM IN DESIGN VIEW.
CLICK THE AUTO ORDER BUTTON TO AUTOMATICALLY REORDER THE FORM CONTROLS, BASED ON THEIR POSITION IN THE FORM.