Results 1 to 6 of 6
  1. #1
    spacekowboy is offline Novice
    Windows XP Access 2003
    Join Date
    May 2012
    Posts
    17

    Link to external files


    Hi, the result of my query includes a field with file names that are located in an external folder. I would like click on these files and open them. How can I create links for the files? Any help on this would be appreciated

  2. #2
    John_G is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    Instead of just the file name, try putting the full path in the links.

  3. #3
    spacekowboy is offline Novice
    Windows XP Access 2003
    Join Date
    May 2012
    Posts
    17
    Do I need to change the data type of the field? Also there are over 65K records!

  4. #4
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    My preference is to store the path as text. Another option is to add the path as a constant. So you could "hard code" the part of the path that is consistent, adding the file name to the path as needed.

    There are a couple ways to turn text into a hyperlink. A button click could open a file, for instance.

  5. #5
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    I also use a plain text field. You can use FollowHyperlink to open the file, as well as other methods.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  6. #6
    Micron is offline Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,801
    Followhyperlink may produce network security/access issues since that method is an old holdover that was meant for browsers. Opening a file in such a way can cause problems in Windows. A couple of methods that I have used is to use the File Dialog to open the folder (handy if there are several files in there that you want to open simultaneously). Another way is to use the Shell Execute or Shell Execute API (more powerful but a bit harder to use). If you know the file type, try the Shell function and see how it works for you. If you know the path, in code you could loop through the records and pass the file name to a little function that you use to open the file. It would then return and process the next function call. But surely you do not want to open all the files in the entire record list if it's as big as you say?

    Shell """C:\....\MSACCESS.exe C:\Yourdb.mdb /Excl /x mcrStartup"""

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

Similar Threads

  1. Replies: 16
    Last Post: 05-21-2015, 07:50 PM
  2. Replies: 0
    Last Post: 12-15-2014, 08:18 AM
  3. Macro to mimic Import & Link Excel button on external data
    By arnstrb in forum Import/Export Data
    Replies: 1
    Last Post: 03-16-2014, 07:52 PM
  4. Really need help with external excel files
    By zu3st3r in forum Import/Export Data
    Replies: 6
    Last Post: 02-04-2012, 02:48 AM
  5. Replies: 3
    Last Post: 11-14-2009, 05:03 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