After you get the controls that you need onto the form, it's time to consider the formatting and layout. It is tricky to get everything exactly right when you first drop controls onto the form.
You will want to create a look and arrangement for your controls that makes it easy to read and to enter data. In the last lesson, you worked with adding controls to the form, resizing them, and aligning them. In this lesson you will look into spacing controls evenly, adding lines and rectangles, and controlling the tab order.
The TAB key has different effects in different programs. In Excel it moves the focus to the next cell to the right. In Word it moves the cursor to the next Tab stop on the ruler. In Access the TAB key moves the focus to the 'next' control. It does not behave quite the same in Form View as it does in Form Design View.
It is important that forms have a clear organization and a logical tab order. The tab order on a form should match the order in which the user will naturally try to enter data.
Tab order for a form is set in Form Design View in the Tab Order dialog, but it only applies to Form View. The Form Design View has it own tab order to help you select objects for editing, like controls, labels, lines, and shapes. You cannot edit the tab order for Design View.
You must set the tab order separately for each section of the form - Form Header, Detail, and Form Footer. Usually you will not want users to be able to TAB in the header or footer. The Detail section is normally where you put the controls which the users would like to select with the TAB key in Form View.
When you are editing in Design View, it is useful to be able to TAB to select any of the controls, including lines, shapes, and decorative images. Sometimes objects overlap or are too close to a section bar to see or click on.
Useful facts about TAB in Design View:
When you are entering or viewing data with a form, you want the TAB key to move the focus ONLY to controls with data.
Useful Facts about TAB in Form View:
It is important that the tab order be logical! If you moved fields around or inserted them without considering the order, you will need to change the tab order.
If a form is not arranged with a single column of controls, the default tab order may not work well.
The example is from the DayCamp.accdb database from your resource files. The controls are mostly in two columns but there are strays at the top (check boxes) and bottom (T-shirt boxes).
To open the Tab Order dialog:
Context Menu: Right click in Design View and select Tab Order...
Ribbon:
Access 2007:
Form Design Tools: Arrange: Tab Order button
Access 2010, 2013, 2016:
Form Design Tools: Design: Tab Order button
Tab Order Dialog: Lists the order that the TAB key moves the focus through the controls in
the form. The illustration is for the example form. TAB will move the focus from Comment (which has a caption of 'Medical Info') to T-shirt
type, then to T-shirt size, which is
the last control in the list.
But, the way the controls are now arranged on the form (which matches the sign-up forms), the focus should
move down the left column to Grade and then to T-shirt type, then T-shirt
size, and then to the top of the next
column, Home Phone.
Auto Order: The
Auto Order button on the dialog sets the order as left-to-right and then
top-to-bottom. The tab order at the right shows the Auto Order for the example form. Compare
this to the example form. Tabbing with Auto Order in place will move you across the form first and then drop down and go across again. Sometimes that is just what you want,
but not for the example form.
What determines the initial order: The order the controls were added to the form is the default TAB order.
To change the order: Move the mouse pointer over the left side of
the list until it turns to the Select Row shape
.
Click on a name or hold the left mouse button down and drag across several names to select them.
Then move the mouse pointer over the square at the left again until it turns to
the Select shape
.
Drag the selected items to a new position. A thick black
line shows where the selection will be dropped when you release the mouse
button.
Users do not need to enter data in calculated controls and AutoNumber controls. It
is annoying to users to have to tab extra times to get past controls that
they cannot edit. So you need to remove those kinds of controls from the tab order.
Surprisingly, the Tab Order dialog does not let you delete items from the list. The Tab Stop property for the control is just what you need for this situation. Select the control, open the Property Sheet, set the Tab Stop property to No. (Look on the Other tab of the Property Sheet to find it quickly.)
The control is still clickable, so a user can select it and copy its data if they need it. But the TAB and arrow keys will skip the control.
If
do not want users to be able to copy the value in the control,
you can also set the Enabled property to No.
Controls that are disabled
have a different color background and grayed out text. The label text is
also grayed out.
Warning: The user cannot copy a value from a disabled control. Are you sure that won't create a problem?
![]() |
Step-by-Step: Format Form |
![]() |
What you will learn: | to change spacing to edit labels to draw a rectangle to format a rectangle and send to back to copy and paste controls from another form to change the tab order for Form View to remove a control from the tab order and disable a control for editing |
Start with: , resource files, worldtravel-Lastname-Firstname.accdb from folder databases project4 as updated in the previous lesson
Access lets you control the spacing between controls besides dragging things around. You can set all the spaces to be the same = evenly. Or you can increase or decrease horizontal or vertical spacing until you are satisfied.
Whoops. Access has gone crazy!
It has added far too much space in some places and removed what was there in others! <sigh>
Note: Your form will probably not look exactly like the illustration, depending on exactly how your
columns lined up on the grid.
Let's try a
smaller set of controls to help Access not get so confused.
Select the controls in the first column.
You can drag across them or use the ruler to select.
Increase vertical spacing:
From
the ribbon tab Form Design Tools: Arrange:
What happened:
Repeat for the third column.
Some parts overlap! Not at all what you would expect.
The overlaps occur with the EmailAddress and Photograph controls, whose labels are above the control instead of being to the left. Access apparently spaces the controls and ignores what that does to the labels in that case.
Select the phone number controls and Decrease Vertical spacing.
The label for EmailAddress is now in the clear.
All controls and labels should be clear of overlaps now.
Save the form.
[Clients]
Switch to Form View and navigate through the records.
Does the data show in the controls nicely? Are the controls comfortably spaced?
Everything but a couple of international phone numbers should be showing nicely. Perhaps you should make some changes now to the phone number controls.
You need to edit the labels and enlarge the controls for phone numbers without making the form any wider than its current 8".
Edit the labels to remove "Phone" and "Number" from the text.
Select the labels and size to fit.
Select the controls for the phone numbers.
Drag them as wide as possible to the left without overlapping the labels.
One of the common reasons for viewing a Client record is to get a phone number or email address. There a many ways to make that commonly-needed information easier to spot. One way is to group those controls visually.
The ribbon tab has buttons for drawing lines and rectangles. These are used to divide or group areas on the form, or just for decorative effects.
Switch to Form Design View.
On
the ribbon tab Form Design Tools: Design, click on the Rectangle button
.
The mouse pointer changes to the Draw Rectangle shape.
Drag on the form to draw a rectangle around
all of the phone numbers and the email address.
Do not draw outside the form boundary. That would force the form to enlarge.
Save the form. (Clients)
The rectangle gathers the phone numbers together visually, but just barely. It is not very visible with its thin border andthe default transparent background. You can change the formatting for the rectangle of the rectangle. Adding a color to the background means you have to change its stacking order. It has to be beneath the controls.
Change
Back Style = Normal
Back Color = Text Light (from the drop list, not the ellipsis button)
This makes the rectangle solid instead of transparent.
Unfortunately, the rectangle now hides the controls it was supposed to make more visible!
Switch to Form View.
The colored rectangle is now behind the phone numbers and email address. They are now easier to see amid all those text boxes.
You created a header in a previous form that you can copy and paste to this one.
Paste.
The two controls that you copied appear in the Form Header section and the form header enlarged a bit to hold the controls. But the controls did not land where you clicked. They landed at the top left.
"Tab Order" is the order that you move through the controls when you press the TAB key. Design View and Form View handle this differently.
TAB in Design View: The 'next' control is selected. All controls are included in the tab order.
TAB In Form View: Moves the focus to the 'next' control for entering or editing the data in that control. Only data controls are in the tab order.
First you should experience the existing tab order in both Design and Form views, then you can change it to work better.
Press the TAB key on your keyboard repeatedly to move the selection through the whole form until you are back in the header.
Observe carefully the order that the selection is moving. This is the tab order.
Notice that the labels and the rectangle get selected.
Access 2007 uses the order in which the controls were added to the form as the tab order in Design View.
Access 2010, 2013, 2016: TAB moves the selection from left to right and then drops down to move left to right again through the controls. This works better if the controls are aligned with each other going across! Your form was deliberately left out of alignment between columns. So the path that TAB takes you on may look rather random at first! Evenly weirder, controls may be skipped altogether! My working copy of the form would not select the Client and OrganizationName controls or labels when tabbing through the controls. It would not go back to World Travel Inc after finishing one round through the controls but wound up on Clients instead. Experimenting with some other forms showed similar unpredictable glitches in the tab order in Design View.
Text data type aligns left. Number or Date data type aligns right.
Right click on the form and select Tab Order...
The Tab Order dialog for Form View appears.
The Auto Order button on this dialog sets the tab order as from left-to-right and
top-to-bottom. So TAB would move you across first and then drop down a
row. That is NOT what we want for this form.
The logical tab order for this form would be down the first column, then down the second column, and finally down the third column.
You will change the order by selecting a control's name in the Custom
Order list and dragging it to a new position.
Similarly, move HealthIssues and Notes upwards until they are below Country in the list.
Leave DateUpdated as last in the list. When editing a record or creating a new record, that one should be changed last - to the current date.
The Property Sheet includes properties that keep a user from being able to TAB into a control and also to disable the control entirely. This is useful for calculated or AutoNumber fields since the user cannot edit those anyway. The disadvantage is that the values cannot be copied if the control is disabled.
You can use your new skills to improve the Staff form. Practice makes perfect!
You will add two new skills, too - Adding a dividing line and adding an unbound control with an expression as its source.
Save the revised form.
[Staff-formatted]
Evaluate: Check all of the records in Form View.
Are the controls in a usable arrangement? An excellent arrangement?
Is your monitor screen showing all of the controls at once or do you have to scroll? How about on a laptop? Is the bottom row of controls visible when you first open a record? Should it be?
Should all of the address fields be in the same column? What could be left out or put in another form?
These are some of the issues that database designers must consider. There are no perfect answers unless you know what hardware the users of the database will be using - now and in the future!