-
linking pictures with the database
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.
-
-
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
[vba]
If Not Me!Photo = "" Or Not IsNull(Me!Photo) Then
Me!Picture.Picture = foldername & Me!Photo
Else
Me!Picture.Picture = ""
End If[/vba]
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.
-
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules