Results 1 to 4 of 4
  1. #1
    Juniorz is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Sep 2014
    Posts
    2

    Add an image based on field result

    Hello,



    I am creating a student record form, which is self entered by a teacher. Im having trouble trying to add a image from a directory on the computer. i do not wish to add images to the database but link them in.

    The photos are all stored in a set folder directory, these photos are all named after the student ID number.

    What i'm trying to do is when a students number is entered in the student ID field the image box can pick this up and display the appropriate picture from the folder.

    Any help appreciated.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Use an Image control. Set its ControlSource to an expression that concatenates the folder path with the student ID number, like:

    ="C:\path\" & [StudentID] & ".jpg"

    Where is the photos folder located - on a network file server?
    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
    Juniorz is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Sep 2014
    Posts
    2
    oh sweet, its beautiful. Thanks!

    Yeah on a network server. Curious though. If a user doesn't have permission to this folder will they see the photo?

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Probably not. Need at least read permission.

    Is this a split db and each user runs their own copy of frontend?

    If you use drive letter path in the expression, each user must have that drive mapped by Windows on their machine. Use UNC path in the expression and drive mapping is irrelevant.

    ="\\server name\path\" & [StudentID] & ".jpg"
    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.

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

Similar Threads

  1. Replies: 2
    Last Post: 11-27-2013, 05:24 PM
  2. Change field color based on result
    By dniezby in forum Programming
    Replies: 1
    Last Post: 05-01-2013, 09:43 PM
  3. Show/ hide image based on some field value
    By capitala in forum Reports
    Replies: 4
    Last Post: 04-06-2013, 10:56 AM
  4. Replies: 3
    Last Post: 02-27-2012, 05:10 PM
  5. Query result based upon two field conditions
    By diane802 in forum Access
    Replies: 35
    Last Post: 01-08-2010, 06:31 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