If you want to show an image that is related to each record, the best data type for the field is Attachment. On a form an Attachment control can show a different image for each record. An Image control, however, can only show the same image in every record.
An Attachment field can contain an image, spreadsheet, word processing document, or any other kind of file. In fact, each record can have multiple files attached!
When the record opens, the file that is first alphabetically in the list of attachments shows in the Attachment control. To see other attachments, select the Attachment control. A mini-toolbar pops up with navigation arrows . Click the arrows to view each image or program icon. The form itself does not show how many attachments there are or what the file names are.
Make it show first: Change the file name to have an underscore in front of the file name before adding it to the record. That will put the name first alphabetically, if it is the only file with an underscore as the first character.
You can attach a file to a record in Table Datasheet View, Form Datasheet View, or Form View. You cannot type anything in the control.
Open the Attachment dialog with one of the following methods:
Method 1: Double click the Attachment field or control.
Method 2: Right click on the Attachment field or control and in the context menu, select Manage Attachments.
Method 3: Click the paper clip icon in the mini-toolbar .
The control must be selected for the mini-toolbar to appear.
The Attachments dialog opens and lists the names of files that are already attached.
Navigate to find the file you wish to attach, select it, and click the Open button.
The file appears in the file list.
Now you can add repeat to add more files or click OK to close the dialog.
Datasheet
view: A datasheet never shows the actual attached image or
document. In Datasheet View you will see only a paper clip icon and how many attached documents there are.
Form View: The control on a form or report will show an attached image if Access understands the file format.
For other kinds of attached files, it shows an icon for the program on the computer that can open that file type, if the program is installed on the computer.
Example icons:
Word, Excel, Notepad, PaintShopPro (for image files), Adobe Reader, unknown file type.
The image or icon that shows in the control by default is the first one alphabetically in the list of files in the Attachments dialog.
Mini-toolbar : Appears only when you click in an Attachment type control on a form. It has navigation arrows to show the different images/icons. When you move to a different record and come back to the record, the control returns to the first image/icon. The paper clip button opens the Attachment dialog.
To show ALL of the attachments without having to navigate to each one, you must use a subform. We will learn about that later in this project.
What to do about images that don't display:
Use a graphics program to convert your images to a format that Access understands.
![]() |
Step-by-Step: Record Images |
![]() |
What you will learn: | to insert images in datasheet Attachment field to format an Attachment control with Property Sheet to compare database file sizes to compact database and compare again |
Start with: , resource files, worldtravel-Lastname-Firstname.accdb from folder databases project4 as updated in the previous lesson
You will add images to your Staff table records. It will be interesting to see what effect on the database's file size adding the images will have.
Warning: File
Size Increase
As you add images to records in this lesson, the database file size
will increase a LOT. Be sure that the disk you are saving your database
to has LOTS of empty space.
Before adding any images or new objects, you need a copy of the database at its smallest size. Backing up the database is the easiest way to get that. Besides, you should be making backups regularly anyway.
Close any open forms or tables and save if necessary.
Back up this database now so you will have a good copy to use if you need to start over. This works well while the database is small.
Access 2007: Office button > Manage > Back Up Database
Access 2010: File tab > Save and Publish > Back Up Database > Save As
Access 2013, 2016: File tab > Save As > Save Database As > Back Up Database > Save As button
If necessary, navigate to your databases project4 folder on your Class disk.
Save with the name worldtravel-beforerecordimages-Lastname-Firstname.accdb .
The database closes. A copy is made with the name that you chose and is compacted. The
original database opens.
You will see security warnings again if you saw them the first time you
opened the database.
Open a File Explorer or My Computer window and navigate to your Class disk to the databases project4 folder.
You should see at least three versions of the database:
worldtravel-beforeimages-Lastname-Firstname.accdb , the copy before you added a background and a logo
worldtravel-beforerecordimages-Lastname-Firstname.accdb , the copy before doing the lesson steps below on this page.
worldtravel-Lastname-Firstname.accdb, the current copy - not compacted since the 'before images' copy.
Write down the sizes of these files. (They are almost certainly different from
the illustration!) As you work, the database size increases. Compacting it
reduces the size somewhat. When you do a backup, the file is
automatically compacted as part of the process.
You can leave the File Explorer or My Computer window open.
You can add an image to a table directly in Table Datasheet View or in Form Datasheet View. The image won't display in the datasheet and it does not show the file name either. That makes it hard to tell if you got the right file! You will usually want to add an image to a record via a form.
Disclaimer: All of the images of people are from clip art collections.
Scroll to the Photograph field.
This column shows the paper clip icon as an Attachment field instead of its name. Not very helpful!
Each record shows 0 attachments.
Open the form Staff-format control to see the image.
Better!
In Form View you have a chance of noticing if you inserted the
wrong image since you can easily see whose record this is. In the
Datasheet View the person's name was out of sight to the left and you
could not see the image itself or even the file name.
Once you start putting images into your records, you may need to tweak the form layout. In this section you will look at Size Mode and Background properties.
Switch back to Form View and look at the three records with photos.
Parts of the photo are cut off. Not a good look!
Similarly, add JPG photos to the records of other employees from the resource files.
There is no photo in the JPG format for the Mr. Kennedy. Use the image photonotavailable.jpg for him, NOT the BMP format image (which is used in the lessons for Access 97 - 2003).
What happened to the photo for record #7 (Sheila Landers)? The photo is far too large to fit inside this control with Size Mode = Clip. Since Picture Alignment = Center, the control shows the center part of the photo. This photo really should have been resized before being added to the database. You won't always have a choice.
Resize
with a graphics program: Your image usually will look better if you used a graphics program to resize the image to
the correct size for your control instead of letting Access resize with Zoom. For
this form you need to crop the image to a square size and then resize,
if necessary, to 1.25" square. Then you can sharpen the image.
Switch back to Form View and look at all of the records.
With Zoom on, any leftover space in the control will show the control's background color. The control's border shows also.
Form purpose affects design choices:
Now that you have added images to the records, will there be any difference in the file size?