Results 1 to 2 of 2
  1. #1
    dillopk is offline Novice
    Windows 7 64bit Access 2013 64bit
    Join Date
    Jul 2016
    Posts
    6

    Any easy way to get an attachment's file name?


    I have a table whose records contain attachments of jpg files. (Yes I know this can make my database very large.) The names of the attached files, which are created by the camera, contain date information I would like to extract. For example, an attached file is named "IMG_20160725_150253293.jpg" (without the quotes). Is there an easy way to get that name into a text field so I can use LEFT, MID, etc to get the year, month, day etc. that that camera assigned? My goal is to extract the date from the file name instead of having to enter it. By the way there is only a single attachment per record.

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,523
    The attachment is a recordset,so
    set rst = currentdb.openrecordset([field])
    sPath=rst.field(0)

    Yr= mid(sPath,5,4)
    mo= mid(sPath,9,2)
    Day= mid(sPath,11,2)

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

Similar Threads

  1. File Attachment Field
    By davek81 in forum Forms
    Replies: 2
    Last Post: 03-29-2015, 12:24 PM
  2. Web Database - file attachment
    By msaccess in forum Access
    Replies: 1
    Last Post: 10-01-2013, 12:36 PM
  3. Replies: 3
    Last Post: 05-02-2011, 07:34 AM
  4. Replies: 0
    Last Post: 03-29-2011, 09:37 AM
  5. How would you output an XML file with an Ole Attachment?
    By techneophyte in forum Programming
    Replies: 7
    Last Post: 09-09-2010, 09:09 AM

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