Results 1 to 6 of 6
  1. #1
    lawdy is offline Competent Performer
    Windows 7 32bit Access 2013
    Join Date
    Jan 2013
    Posts
    172

    Trouble with FollowHyperlink

    On a form, I have 2 buttons:


    Private Sub btnHyperLink_1_Click()
    FollowHyperlink "L:/20231470.pdf"
    End Sub
    and
    Private Sub btnHyperLink_2_Click()
    FollowHyperlink "L:/aaTS/AFilesToCopy/Job Plans/2023/20231470.pdf"
    End Sub


    btnHyperLink_1 works real good but btnHyperLink_2 don't work at all. The file IS located at both locations. Is there a limit on how deep one can go in the file system or am I doing it wrong?

  2. #2
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,801
    AFAIK there is a limit but it is over 1,000 characters. Can only think that your issue must be that the 2nd path is not correct, even if by only one character or space. Try navigating to the file in File Explorer and copy/paste the path (and add file name to it) in your code.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #3
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,940
    Suprised that even worked as I would use \ as it is Windows and not Linux/Unix?

    However it appears to do so.
    What error message are you getting?
    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
    lawdy is offline Competent Performer
    Windows 7 32bit Access 2013
    Join Date
    Jan 2013
    Posts
    172
    Ok, you hit it. I had left out 1 character in the string. I also changed the '/' to '\'. Thanks to both of you for solving my problem.

  5. #5
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,801
    It works either way for me. In fact, it works with a mix of / and \. However, using / raises a security warning dialog. Methinks Shell might be a more reliable way of doing this.

    http://access.mvps.org/access/api/api0018.htm
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  6. #6
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,940
    Quote Originally Posted by Micron View Post
    It works either way for me. In fact, it works with a mix of / and \. However, using / raises a security warning dialog. Methinks Shell might be a more reliable way of doing this.

    http://access.mvps.org/access/api/api0018.htm
    Yes, even with Dir
    ? dir("f:/temp/Music List.pdf")
    Music List.pdf


    However I will stick with \ for Windows and / for Linux and not confuse myself.
    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

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

Similar Threads

  1. FollowHyperlink video options
    By nigelm in forum Access
    Replies: 13
    Last Post: 09-29-2022, 08:52 PM
  2. followhyperlink
    By Agrilima in forum Access
    Replies: 2
    Last Post: 02-12-2021, 08:25 AM
  3. using FollowHyperlink
    By Jen0dorf in forum Modules
    Replies: 5
    Last Post: 11-24-2015, 04:30 PM
  4. FollowHyperlink Help
    By RachelBedi in forum Access
    Replies: 6
    Last Post: 01-18-2013, 08:22 AM
  5. Set IE window size using followhyperlink
    By AndrewAfresh in forum Access
    Replies: 0
    Last Post: 11-23-2006, 12:22 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