Add a Browse for Image Button to an Access 2010 Form
Question details
Add a button that lets users select an image, save its file path, and display it on an Access form.

- Product
- Microsoft Access 2010
- Device & OS
- not provided
- Scenario
- A user wants to choose an image for each record without storing the image file in the database.
- Observed behavior
- The form should save the selected image's path in a text field and display the corresponding image.
Open the database and identify the table and form where you want to store and display image paths. Keep the image files in a location that form users can access, and enable database content if Access blocks VBA.
Use a file picker and a bound image control
Use this method to store an image file path in each record and show the picture on the form.
The database stores the path, not the image itself. If the file is moved, renamed, or unavailable to another user, Access cannot display it.
Open the form's source table in Design View, add a Text field named ImagePath, and save the table. Access 2010 Text fields hold up to 255 characters, so use paths that fit within that limit.
Open the form in Design View. If necessary, add ImagePath to the form's record source, then add a text box and set its Control Source to ImagePath and its Name to txtImagePath in the Property Sheet.
On the Design tab, add an Image control to the form. In its Property Sheet, set Control Source to ImagePath and adjust the control's size and Size Mode as needed.
On the Design tab, add a Button control, cancel the wizard if it opens, and name the button btnBrowseImage. On the Event tab of its Property Sheet, set On Click to [Event Procedure], then click the ellipsis button.
In the VBA editor, add the following code inside the btnBrowseImage_Click procedure: With Application.FileDialog(3) .Title = "Select an image" .AllowMultiSelect = False .Filters.Clear .Filters.Add "Image files", "*.jpg;*.jpeg;*.png;*.bmp;*.gif" If .Show = -1 Then Me!txtImagePath = .SelectedItems(1) End If End With
Save the form, switch to Form View, and click the browse button. Select an image, confirm that its path and picture appear, and save the record, for example by moving to another record.

Work with image-based spreadsheets in WPS Office
WPS Office is a free, lightweight alternative with a familiar interface and Microsoft Office format compatibility, making it easy to move spreadsheet work between suites. It does not replace Access forms or run this Access VBA solution.

Frequently Asked Questions
Does this method store the image inside the Access database?
No. The ImagePath text field stores the file path. The image remains in its original folder.
Why is the image missing when another user opens the form?
The saved path may point to a folder that the other user cannot access. Move the image to an accessible shared location and select it again with the browse button.
What happens if I move or rename an image?
The saved path will no longer point to the file. Open the record in Form View and use the browse button to select the image at its new location.
Why doesn't the browse button run?
Check the button's Property Sheet to make sure On Click is set to [Event Procedure] and the code is inside its Click procedure. If Access has disabled database content, enable it only if you trust the database.




