Results 1 to 2 of 2
  1. #1
    sgrawunder is offline Novice
    Windows 10 Access 2007
    Join Date
    Jan 2020
    Posts
    1

    String the full path to the photo name when inserting photos in a form

    Hi to All,
    I have a database for a quilt show, we will be registering over 100 quilts and each entry requires a photo for identification.


    I have set up the form with a field PhotoID for the path, and then inserted an image field with the control source as the PhotoID field. All works as it should but the path to the photo folder is quite long and it seemed ridiculous to me that I shouldn't be able to have the path as a "constant" and the photo name as a "variable" and then string them together via an OnExit
    procedure or macro
    or something.
    In other words, if I type Photo1 in the PhotoID field it would string the full path to Photo1 to retrieve the photo to the image box.
    Does this make any sense LOL???
    Thanks for your help,
    Sandra

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    Options:

    1. hard code path string and concatenate with field in the ControlSource, like:

    ="string path" & [PhotoID]

    2. build a VBA function in a general module that returns the string path and concatenate with field in ControlSource, like:

    =GetPath() & [PhotoID]

    Function code like:

    Function GetPath()
    GetPath = "string path"
    End Function
    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: 1
    Last Post: 11-21-2018, 05:02 PM
  2. Replies: 11
    Last Post: 08-26-2016, 11:51 AM
  3. Replies: 0
    Last Post: 06-23-2016, 05:09 PM
  4. Finding photos in network based on photo tags
    By LonghronJ in forum Modules
    Replies: 1
    Last Post: 02-18-2016, 04:02 PM
  5. Replies: 4
    Last Post: 08-29-2011, 12:36 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