Results 1 to 8 of 8
  1. #1
    DC CS is offline Advanced Beginner
    Windows 11 Office 365
    Join Date
    Jan 2023
    Location
    Vaalpark, South Africa
    Posts
    69

    Attachments

    Hi all,
    Not sure where to post this question, but here it is:

    What is the best way to handle attachments in Access?



    1. If I add the attachments into the table, it will increase the size of the DB very quickly (limit of 2GB per DB).
    2. If I only save the path of where the file is located on the server in the table, and the user wants to open that specific file, how do I accomplish this? (Saving the attachment in the table, will automatically use the program it was created with...)

    Most files that will be saved, are PDF files, but there might be other formats as well.

    Thanks
    DC

  2. #2
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Office 365
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,977
    Suggest you always use method 2:
    Save the file path then open it using Application.FollowHyperlink or other suitable code
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  3. #3
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,940
    @RanMan256 constantly posts code on here that will open any file with the associated program.
    Have a search for that.
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  4. #4
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Office 365
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,977
    Quote Originally Posted by Welshgasman View Post
    @RanMan256 constantly posts code on here that will open any file with the associated program.
    Have a search for that.
    I also have my own similar code.
    However, no need to use such file handling function. FollowHyperlink does exactly the same thing and its built-in
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  5. #5
    Amicron's Avatar
    Amicron is offline Access Guru
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2011
    Location
    Amherst, New York (near Buffalo)
    Posts
    31
    I agree with Colin 100%. The best way to handle attachments in Access is to NOT use them.

    Here's a video that explains how to use FollowHyperlink:

    Follow Hyperlink: https://599cd.com/FollowHyperlink
    Last edited by Amicron; 07-12-2023 at 02:57 PM. Reason: updated info

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    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.

  7. #7
    Jimruns919 is offline Advanced Beginner
    Windows 10 Access 2019
    Join Date
    Jun 2023
    Location
    Pennsylvania
    Posts
    32
    I was wondering this myself. I know how to use the followhyperlink option, but what I am curious about is that I am creating a Purchase Order system for my job.

    What is being asked is about attaching the PDF invoices we receive with the PO and I want to do that with the followhyperlink. Is there anyway for this to be programmed so the user just attaches the file and then the programming puts it into a designated folder and then creates the hyperlink for the accounting dept to click on to view it?

  8. #8
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    What do you mean by "user just attaches the file"? Can open File System Object file picker dialog for user to select file then code can move/copy file and save file name to field. This is a common topic.
    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. Adding attachments to email, saving attachments
    By snsmith in forum Programming
    Replies: 31
    Last Post: 09-10-2021, 08:25 AM
  2. Attachments
    By Catago in forum Access
    Replies: 1
    Last Post: 01-08-2021, 08:42 AM
  3. Replies: 2
    Last Post: 01-29-2014, 03:19 PM
  4. Attachments
    By JayX in forum Access
    Replies: 5
    Last Post: 12-27-2011, 03:08 PM
  5. attachments
    By chiefmsb in forum Access
    Replies: 0
    Last Post: 07-08-2011, 03:56 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