-
In the Customers form,
point to the bottom of the Form
Header section, and when the pointer changes to a
double-headed arrow, drag downward to increase the header size to
about 1.5 inches.
-
In the Form Header
section, select the logo control, hold down the Shift key, and
select the label control. Then press the Delete key.
-
On the Design contextual
tab, in the Controls group,
click the Insert Image button,
and then click Browse.
Tip
If the Hydrangeas image already appears in the Image
gallery displayed when you click the Insert Image button, you
can simply click the image instead of browsing to it.
-
In the Insert Picture
dialog box. Then
change the type of file from Web-Ready
Image Files to All
Files, and double-click Hydrangeas.
-
Point to the upper-left corner of the Form Header section, and drag diagonally
to draw a box about 1 inch high and 1.5 inches wide.
The picture is inserted into the image control.
Tip
How adjustments of an image in a control of image is determined by the property of mode of size of control. If the property is placed to cross and controls it is not enough large to show the whole image, the image is cultivated. If the property is placed at the right end, you can increase control to show the whole image. If the property is placed to hum (the defect), the image gives to the coast automatically to adapt control.
-
In the Controls group,
display the Controls
gallery.
Depending on the size of your program window and your screen
resolution, you might need to click the More button or the
Controls button to display this gallery.
-
In the gallery, click the Label button, and then to the right of
the picture in the Form Header
section, drag diagonally to draw a box about 2 inches wide and 0.5
inch tall.
Access inserts a label control containing the cursor, ready
for you to enter a title for the form.
-
In the active label control, type Garden Company. Then press Shift+Enter to
insert a line break, and type Customers.
-
Click the Form Header
section bar. On the Format
contextual tab, in the Control
Formatting group, click the Shape Fill button. Then under Theme Colors in the palette, click the
third box (Light Green, Background
2).
-
Select the label text, and in the Font group, make the text 20 points,
bold, and dark green. Then center the text.
-
If Garden Company wraps
to two lines, drag the sizing handle in the middle of the right
side of the label frame to the right until the text fits on one
line. Then on the Arrange tab,
in the Sizing & Ordering
group, click the Size/Space
button, and under Size in the
Size/Space gallery, click
To Fit.
The label control now fits its text.
-
Reduce the height of the Form
Header section so that it is just big enough to contain
its controls.
The form now has a more prominent title.
-
On the Design tab,
display the Controls gallery,
and verify that the Use Control
Wizards button is not orange. If the button is orange
(active), click it to deactivate it.
When the Control Wizards feature is turned off, you can add
a control with all its default settings, without having to work
through the associated wizard’s pages.
-
Enlarge the Detail
section to create at least an inch of space below the Country controls.
We want to create a combo box that displays a list of
possible countries but that also allows users to type the country
if it is not already in the list.
-
In the Controls
gallery, click the Combo Box button. Then drag diagonally
to draw a box below the Country
text box control. Make it about 1.5 inches wide and about 0.25
inch tall.
When you release the mouse button, Access displays a combo
box control and an associated label control.
Tip
Access assigns a number to each control when it is
created. Don’t be concerned if the numbers associated with the
controls you create are different from those in our
graphics.
-
Click the Country text
box control. On the Format
contextual tab, in the Font
group, click the Format Painter
button, and then click the combo box control.
Access copies the formatting of the Country text box to the
combo box control and its label.
-
Right-click the combo box, and then click Properties to open the Property Sheet.
Now let’s create a simple query that extracts one example of
every country in the Country field of the Customers table and
displays the results as a list when users click the combo box
arrow.
-
Click the Data tab of the
Property Sheet. Then click the
Control
Source arrow, and in the list, click Country.
In the combo box control on the form,
Unbound has been replaced by
Country.
-
Verify that the Row Source
Type property is set to Table/Query. Then in the Row Source box, type the
following:
SELECT DISTINCT
Customers.Country FROM Customers;
There is a period (but no space) between
Customers and Country,
and a semicolon at the end of the text.
-
Click the combo box label control. Click the
Format tab of the Property Sheet, and change the Caption property to Country.
-
Click the original Country text box control, and press
Delete to delete the control and its associated label. Then move
the new combo box and label into their places, resizing them as
needed.
Tip
To make sure that new controls are aligned with existing controls, you can click on an existing control and note its width, cuts, above, and left properties. Employ then which of these arrangements are adapted to regulate with precision new control.
-
Shrink the size of the Detail section until it is only as wide
and as tall as it needs to be to hold its controls.
-
On the Design tab, in the
Controls gallery, click the
Line control, and drag a line
across the width of the form to separate the name and phone number
information from the address.
-
In the Property Sheet,
set the Height property to
0 and the Border Width property to 2 pt. Then close the Property Sheet.
Tip
Setting the height to 0 does not make the line invisible;
it ensures that the line is straight.
-
With the line still selected, on the Format tab, in the Control Formatting group, click the
Shape Outline button, and set
the line color to dark green.
Now let’s make sure that no matter what size the program
window is, the line always stretches across the width of the
form.
-
On the Arrange tab, in
the Position group, click the
Anchoring button.
The Anchoring gallery appears.
-
In the gallery, click the Stretch Across Top thumbnail.
-
Switch to Form view, and try making the program window
various sizes.
Even though the width of the form was only about 5 inches in
Design view, the form header and the line always span the width of
the window.
-
Scroll through a couple of records, and then click the
Country combo box arrow.
Access displays the country list.