View Full Version : linking pictures with the database
DBinPhilly
06-01-2010, 06:09 AM
What is the easiest and most efficient way to link pictures to records in a database?
I know this must be easy, but it's been years since I've needed to do this and my previous efforts have been less than satisfactory. I've succeeded, but ended up with a bloated and very slow database.
Any help would be appreciated.
orange
06-01-2010, 07:59 AM
Check this site. It should get you started.
http://support.microsoft.com/default.aspx?scid=kb;en-us;285820
The easiest way is to just store the Path to the Photo and then use VBA to display it on a form or report.
the VBA looks like this
If Not Me!Photo = "" Or Not IsNull(Me!Photo) Then
Me!Picture.Picture = foldername & Me!Photo
Else
Me!Picture.Picture = ""
End If
Where Me!Photo is the path to the photo and me!Picture.Picture is an Image frame called Picture.
Foldername is optional and is the Path to a Folder holding all your photos, if the Photo field you use holds the full path you don't need the Foldername part of the code.
DBinPhilly
06-02-2010, 05:11 AM
That little subroutine did the trick. Thanks so much.
Couple the last routine with a Windows Explorer-type subroutine to easily find the path to the picture and there you go.
It is fast, easy and takes no space at all.
:beerchug:
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.