Consulting

Results 1 to 4 of 4

Thread: linking pictures with the database

  1. #1

    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.

  2. #2
    VBAX Tutor
    Joined
    Nov 2007
    Posts
    257
    Location
    Check this site. It should get you started.
    http://support.microsoft.com/default...b;en-us;285820

  3. #3
    VBAX Guru
    Joined
    Mar 2005
    Posts
    3,296
    Location
    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.

  4. #4
    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
  •