Results 1 to 4 of 4
  1. #1
    Eddy Sincere is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Jul 2014
    Location
    Carson City, NV
    Posts
    114

    Open an attachment using a command button


    I have a DB that organizes controlled documents because I work in a regulated industry. I currently have a copy of the regulations saved as a PDF and use a hyperlinked command button on a switchboard to access and open the PDF. This works well until I move my DB or the PDF file is inadvertently moved (which my IT department sometimes does). I want to avoid this problem by making the PDF file an attachment in the DB.

    To do this I created a table with an attachment field then I inserted the PDF file. My problem is that I can't figure out how to link actually opening the attachment with a command button. I'm thinking there's some basic VBA that points the button to the specific field within the record in the table. Let me know if you'd like me to post the DB.

    As always, thanks for the help.

  2. #2
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Adding documents in the database is a bad thing to do. Mostly because the database bloats and you reach the size limit rather quickly.

    It would be better to have code relink the hyperlinks if the folder with the documents is moved.


    However, that doesn't answer your question. Research the "VBA.Shell" command.
    See this link: https://www.accessforums.net/program...ent-23686.html

  3. #3
    Eddy Sincere is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Jul 2014
    Location
    Carson City, NV
    Posts
    114
    Thanks for the response. I completely agree that having attachments in the DB is a very bad thing to do which is why I use hyperlinks for everything. I'm limiting the attachment to one document because the content doesn't change and it's commonly referenced by everyone.

    I'll take a look and let you know if we can mark this as solved. Thanks again!

  4. #4
    Eddy Sincere is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Jul 2014
    Location
    Carson City, NV
    Posts
    114
    I opted to keep using the hyperlink method as opposed to an attachment. There doesn't seem to be a quick and easy way (read: very little VBA) and the hyperlink is working fine. Thanks for the input.

    AS

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

Similar Threads

  1. Replies: 20
    Last Post: 10-28-2013, 06:26 PM
  2. command button to open attachments
    By tommyried in forum Access
    Replies: 1
    Last Post: 06-20-2012, 07:51 AM
  3. Command button open url
    By patrickmcdiver in forum Programming
    Replies: 2
    Last Post: 03-06-2012, 11:08 AM
  4. Command button to open Report
    By swagger18 in forum Programming
    Replies: 0
    Last Post: 11-17-2011, 02:56 AM
  5. Replies: 1
    Last Post: 07-07-2010, 11:06 AM

Tags for this Thread

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