Results 1 to 3 of 3
  1. #1
    Sirhceth is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Dec 2015
    Posts
    1

    Grabbing images from folder based on filename

    I hope my wording makes sense...



    Basically I have a form which grabs data from a table. Included are 5 bounded object frames that come from 5 image fields in the table. The fields are filled with the file names and not the full directory... for example: c:\temp_pics\1234.jpg would be listed as 1234.jpg.

    Is there a way to use these fields to grab an image from a folder that will have all pictures mentioned in a said database?

    Thanks,

    Sirhceth

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,963
    I use Image control to dynamically display images. Set the ControlSource property to the field with the image path/name. If the data is only the name, the path can be supplied by concatenation of literal text:

    ="c:\temp_pics\" & [fieldname]
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 8 Access 2013
    Join Date
    Aug 2013
    Posts
    7,862
    Is there a way to use these fields to grab an image from a folder that will have all pictures mentioned in a said database?
    Not sure what grabbing an image is, exactly. You will need the full path in order to do anything with a file. I will store file names in their own column. That is a common thing to do. You can use code to concatenate the file name to a known directory and grab the file.

    Dim strPath as string
    dim strFileName as string

    strPath = "c:\temp_pics\"
    strfileName = Me.NameOfControl.Value

    Application.FollowHyperlink strpath & strfilename

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 12
    Last Post: 04-16-2015, 04:44 PM
  2. Replies: 17
    Last Post: 06-04-2013, 07:36 PM
  3. Replies: 2
    Last Post: 01-07-2013, 05:23 AM
  4. Replies: 0
    Last Post: 03-06-2011, 01:46 PM
  5. Displaying images from another folder
    By w3leon in forum Access
    Replies: 0
    Last Post: 01-30-2009, 06:18 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums