Results 1 to 4 of 4
  1. #1
    shann is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2015
    Posts
    4

    Open PDF file

    hello there ive got this code in opening a pdf file

    Code:
    Application.FollowHyperlink "A:\AccessDatabases\Zoning\ZoningArchived\" & "2017-04-25-01-MARCELO-DELPILAR.pdf"
    it works fine, however when i replace it with

    Code:
      Application.FollowHyperlink "A:\AccessDatabases\Zoning\ZoningArchived\" &  me.myFileLocationandName
    It gives me error saying cannot open the file specified.. i just replace the string,, i have same value as well.


    Please guide me.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,772
    This code is in a form event and myFileLocationandName is a field of the form RecordSource?
    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.

  3. #3
    shann is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2015
    Posts
    4
    yes sir .. its in a form triggered by a button.
    myFileLocationandName is a textbox having the string location "A:\AccessDatabases\Zoning\ZoningArchived" & "2017-04-25-01-MARCELO-DELPILAR.pdf"

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,772
    Okay, and the textbox is bound to a field of the same name?

    I cannot replicate the issue. Code works for me.

    Could there be permission issues for that folder?
    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. Replies: 1
    Last Post: 11-28-2014, 06:56 PM
  2. Replies: 2
    Last Post: 06-25-2014, 10:29 PM
  3. Replies: 6
    Last Post: 11-08-2013, 11:18 AM
  4. Replies: 1
    Last Post: 09-27-2010, 10:10 AM
  5. Can not open File already in use.
    By Wrangler in forum Access
    Replies: 1
    Last Post: 03-04-2009, 09:50 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