The way images display is
managed in the Properties dialog.
- Picture: Path to the picture.
Absolute path C:\Company Photos\Staff\gardner.bmp
Relative path ..\photos\staff\gardner.bmp
- Picture Type: Embedded or Linked
- Picture Size Mode: Clip,
Stretch, or Zoom (Examples
- Picture Alignment: Top Left,
Top Right, Center,
Bottom Left, Bottom Right, Form Center
- Picture Tiling: Yes or
Not all of these properties are appropriate for all kinds
of images on a form or report.
For background images and Image controls, you will see
all of these properties. The Properties dialog for the whole form or
report controls background images like textures and watermarks.
For unbound object frames, you will see only Size Mode
(instead of Picture Size Mode), and OLE Type (instead of Picture
For bound object frames (required for pictures in
records) you will see Size Mode and OLE Type, plus OLE Type Allowed.
Where you are:
Before you start...
Project 1: Intro
Project 2: Access Basics
Project 3: Tables & Queries
Project 4: Forms & Reports
Images in Forms & Reports
Special Forms & Reports
Picture Size Mode
All images have a size mode property in the Properties dialog. There
are 3 modes: Clip, Stretch, Zoom.
Shows only what will fit in the control, starting from the upper left corner of the image
Image is stretched or shrunk to
fill the space, even if that deforms the image
Image is stretched or shrunk to fit into the
space but the proportions remain
The control's Back Color shows when the image does not
completely fill the control.
If the Back Color is "Transparent", the form's background
shows in the gaps.
- Match the control's size to the image.
If the control is much larger than the image, Zoom may enlarge the image
so much that its quality becomes poor.
- For images in records, use Zoom if the images in different records are different sizes or
if you don't know what size they might be in the future.
Step-by-Step: Form Images
What you will learn:
|to backup database|
to use Properties dialog to control image display
to add a background image
to add an image to a form in an Image control
to format an Image control
to resize header and footer sections
worldtravel.mdb from the previous lesson
You now have two forms ready for use, plus some versions
of those forms as you went along. Those forms are already formatted, so
you will create a new form that will have a custom background and a form
Before adding any images or new objects, you want to see
what the smallest size is for the database. Backing up the database is the
easiest way to get that. Besides, you should be making backups regularly
Close any open forms or tables and save
From the menu select | The Save Backup As dialog opens.
If necessary, navigate to your
databases project4 folder on your Class disk.
Save with the name worldtravel_beforeimages.mdb.
The database closes. A copy is made with the name that you chose. The
original database opens.
You will see security warnings again if you saw them the first time you
opened the database.
Open a My Computer window and navigate
to your Class disk to the databases project4
folder. You should see worldtravel.mdb and
By the way, you may see a 1 KB file
worldtravel.ldb. This is a temporary file that
appears only while the database is open.
- Write down the sizes of these two files. (They are almost certainly different from
the illustration!) As you work, the database size increases. Compacting it
reduces the size somewhat, sometimes a LOT. When you do a backup, the file is
automatically compacted as part of the process.
You can leave the My Computer window open.
Create New Form
Now you can create a new form that you will add a background and image to
- In the database worldtravel.mdb,
open the Tables list in the Database Window.
an AutoForm for the table Projects.
(Select the table. From New Objects button select AutoForm)
An AutoForm is a good start for a table with just a few fields
like this one.
Save the form as Projects Form.
Add Background Image
The AutoForm used the Standard AutoFormat style, which does not have an
image background, just a color.
to Form Design View.
- From the menu select | .
- Resize the window to show all of the form.
- Drag the bottom edge of the footer up until it vanishes.
necessary, open the Properties dialog for the
- Click on the Format tab and scroll to the
These 5 properties affect the background of the form.
Help about properties:
in the box for the Picture property.
(It shows the text (none).
Press the F1 key.
A Help window opens and loads an article that explains this property.
Read this article, which explains what the
property is all about and what kind of objects have the property. Parts
are very technical but the Remarks section usually has helpful
Repeat for the other "Picture" properties:
Picture Type, Picture Size Mode, and Picture Alignment, Picture Tiling.
- Click in the Picture property's box ,where it
Click the 3 dots button
The Insert Picture dialog appears.
- Navigate to where you saved the databases
the image wall.bmp and click on
The image appears in the center of the form, below all of the
The Properties dialog now shows a path to the image in the Picture
box and uses the default settings for the other Picture properties
- Embedded, Clip mode, Center alignment, and no tiling.
the Picture Tiling property to Yes and click
in another property to
accept the change.
The background for the whole form changed to show the pattern,
including the Form Header and Footer (if you could see the footer).
An image may be appropriate in the Form Header, for example a company
logo. You do want to think carefully, however, about how much space you
want to spend on decorations. You do not want to crowd your data
- Click the Image control button
on the Toolbox bar.
- Move the mouse pointer over the Form Header area.
The pointer changes to the Image shape.
at the upper left of the header area.
A default size Image control appears, the header area resizes, and
the Insert Picture dialog appears.
The Properties dialog changes to show an image control.
- Navigate, if necessary, to where you saved the
The icon beside the file in the dialog or in a My Computer
window will match the graphics program that
is associated with the BMP file type.
The header area resizes again to show the image at its full size.
Format Image and Form Header
The image is too large and needs some more formatting to make this look
image with Properties: With
the image selected, in the Properties dialog, change both the
Width and Height to 1".
- Click in another property to accept the change.
Whoops! The current Picture Size Mode is Clip and the Picture Alignment
value is Center. These property values force the image control to show
just the middle part of the image.
the Picture Size Mode to Zoom.
Now the whole image shows in the smaller Image control.
- Change the Special Effect property to Etched.
bottom edge of the Form Header up to the bottom edge
of the image so that the Form Header section is just tall enough for
Do you see the gap between the image and the border of the control at
the top and at the bottom? This is not highly annoying in this case, but
in other situations it may be very noticeable. You can fix it easily
image by dragging: Drag the bottom edge of the image
control up just one grid row and release.
- Drag the top edge of
the image control down just one grid row and release.
Now the image just fits inside the control.
Switch to Form View to see how this is working out.
form may not have so much empty space at the bottom. Remember that when
switching between views, the window stays the same size. When you open
your form directly, the window will automatically be sized to fit the
Add Labels as Titles
Headers normally have helpful info, like a title.
to Form Design View.
the right of the image, add a label using the Label tool
from the Toolbox bar. Enter as text
World Travel Inc.
- Format the text as
- Add another label below the first
with the text Projects
- Format as
Switch to Form View to see the results.
the form. (Projects Form)
- Close the form.
Compare File Size
Now that you have added a background and an image, will there be any
difference in the file size?
- Verify that all database objects are saved. (Closing them
is a good way to do that.)
- Switch to the My Computer window. (If necessary open
one and navigate
to your Class disk to the databases project4
You should see both worldtravel.mdb and
- Compare the current size of worldtravel.mdb
to the size of
worldtravel_beforeimages.mdb, which was the
size of worldtravel.mdb at the beginning of
this lesson. There should be a significant difference!
- Switch to the Access window for worldtravel.mdb.
- From the menu select | | The database closes, compacts, and reopens.
- Switch to the My Computer window.
- Write down the file sizes
again. You will need the numbers at the end of the next lesson.
Did the World Travel database change sizes much after compacting?
does its size now compare to the size before adding the form images?
(Your file sizes are likely to be different from mine!)