logo
search
Others

How to Store Access Images Outside the Database Using File Paths

Maira MehtabMaira Mehtab Sep 21, 2026 869 views

Question details

The user wants to associate external images with database records by saving the file paths in text fields rather than embedding image files directly, preventing the database file size from increasing.

Product
Microsoft Access
Device & OS
not provided
Scenario
Designing a database form or continuous subform with multiple image fields where images are loaded at runtime from a local or network directory.
Observed behavior
The user is looking to implement a file dialog approach where the selected image path is saved into a bound text field, and an unbound image control displays the corresponding external file horizontally on the form.
Before you start

Ensure that the external image files are stored in a stable, shared network folder or local directory so the file paths remain valid when different users access the database.

Solution 1Recommended

Use File Dialogs and Unbound Image Controls via VBA

Implement a VBA script utilizing Application.FileDialog to capture an image's path, save it to a text field, and dynamically display the file in an unbound Image control.

Embedding files as Attachments or OLE objects rapidly increases an Access database size toward its 2GB limit. Storing just the file paths allows the database to stay lightweight.

You can extend this method to display multiple images in a continuous subform by utilizing separate path fields (e.g., Image1Path, Image2Path) and binding them to corresponding image controls.

1
Create a Text Field

Open your table in Design View and add a Short Text field (e.g., 'PhotoPath') to store the external file directory string.

2
Add an Unbound Image Control

Open your form in Design View, insert an Image control from the ribbon, and cancel the prompt to select a static picture so it remains unbound.

3
Insert a Command Button

Add a command button next to the Image control. This button will be used by users to browse their computer for the image file.

4
Write the FileDialog VBA Code

Right-click the button, select 'Build Event', and choose 'Code Builder'. Write a VBA script using 'Application.FileDialog(msoFileDialogFilePicker)' to let the user select a file and assign the selected path to the 'PhotoPath' text field.

5
Update the Image Control Picture Property

In the form's 'On Current' event, write VBA code to set the Image control's 'Picture' property to the value of 'PhotoPath', ensuring the image refreshes whenever you navigate to a different record.

Limit File Size and Corruption: Using this path-based method significantly reduces database bloat, resulting in faster query performance and a much lower risk of database corruption.
Free Microsoft Office alternative

Manage Data and Images Easily with WPS Spreadsheet

While Microsoft Access handles complex relational databases, you can often track inventory and image links much more simply using a spreadsheet. WPS Office provides a lightweight, highly compatible alternative to Microsoft Office, enabling seamless data management without complicated VBA programming.

  1. 1. Download and Install WPS Office: Visit the official WPS website, download the free suite, and install it on your PC or Mac.
  2. 2. Create an Inventory Spreadsheet: Open WPS Spreadsheet and create columns for your data, such as Item Name, Description, and Image Link.
  3. 3. Insert Images or Hyperlinks: Use the 'Insert' tab to either embed images directly into the spreadsheet cells or add clickable hyperlinks pointing to your local image files.
Completely free and lightweight alternative to Microsoft OfficeFully compatible with Microsoft Excel (.xlsx), Word, and PowerPoint formatsInsert pictures directly into cells or easily manage hyperlinks to external filesFamiliar tabbed interface ensures zero learning curve for new users
microsoft office alternative - wps office

Frequently Asked Questions

Why shouldn't I just use the Attachment data type in Access?

Using the Attachment data type stores the actual image file inside the database. Because Access has a strict 2GB maximum file size limit, embedding images can cause your database to reach this limit very quickly, leading to slow performance and potential file corruption.

How do I let users select an image without typing the file path?

You can use the 'Application.FileDialog' object in VBA. This opens a standard Windows file picker window where users can visually locate their image. The VBA code then extracts the path of the selected file and automatically inputs it into your text field.

Can I arrange multiple image paths horizontally on a continuous subform?

Yes. To achieve this, create separate text fields in your table (e.g., Image1, Image2, Image3). In your continuous subform, place multiple unbound Image controls horizontally. Then, use VBA in the form's 'On Current' event to load the respective file paths into each image control simultaneously.