Results 1 to 7 of 7
  1. #1
    Hendro623 is offline Novice
    Windows 10 Access 2010 32bit
    Join Date
    Dec 2016
    Posts
    14

    Open PDF Located On Local Drive From Access Based On Field In Record

    When we have shipment discrepancies at our company we have the paperwork scanned into a folder and titled by their order number



    I created a database to record discrepancies but I'd like to have a button or hyperlink to open the file path for the order# field in the current DiscID record selected. It seems like a simple thing to do but I cant seem to find a solution to make this work, please help!!

  2. #2
    andy49's Avatar
    andy49 is offline VIP
    Windows 10 Access 2007
    Join Date
    Nov 2016
    Location
    London
    Posts
    1,051

  3. #3
    jwhite is offline Competent Performer
    Windows 10 Access 2013 32bit
    Join Date
    Dec 2012
    Location
    North Carolina
    Posts
    349
    application.FollowHyperlink("C:\Temp")

    Replace C:\Temp with the proper folder. If your folder path includes spaces, may need to be:

    application.FollowHyperlink("""C:\Temp With Spaces""")

  4. #4
    Hendro623 is offline Novice
    Windows 10 Access 2010 32bit
    Join Date
    Dec 2016
    Posts
    14
    How would I reference the order# field though? The path used will be "G:\33RD\Public\DISC BOL" but needs to end up actually following G:\33RD\Public\DISC BOL\[order#]

  5. #5
    jwhite is offline Competent Performer
    Windows 10 Access 2013 32bit
    Join Date
    Dec 2012
    Location
    North Carolina
    Posts
    349
    application.FollowHyperlink("""G:\33RD\Public\DISC BOL\" & [FieldOrVariableOrControlWithYourOrderNumber] & """")

  6. #6
    Hendro623 is offline Novice
    Windows 10 Access 2010 32bit
    Join Date
    Dec 2016
    Posts
    14
    Click image for larger version. 

Name:	Screenshot.png 
Views:	8 
Size:	12.4 KB 
ID:	27739
    This is what I get when I try to run it.

  7. #7
    Micron is online now Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    Your field/control reference is incomplete. Try Me!NameOfYourForm.[order#] instead of just the control reference, or create a variable for the control reference.
    Hard coded network path references are not a great idea. I'd put the path in a table and do a DLookup for the path. If it ever changes, all you have to do is edit the table record (or add to it if you end up with more than one path) instead of editing code. So I'd have G:\33RD\Public\DISC BOL\ in a table and in code, add the file name to it based on the form control that contains the document id. Also, special characters in field/control names is not good practice (#).
    Last edited by Micron; 03-06-2017 at 01:40 PM. Reason: clarification
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

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

Similar Threads

  1. How to open Access from the old drive?
    By Flannery in forum Access
    Replies: 2
    Last Post: 07-12-2016, 08:00 AM
  2. saving access database to local drive
    By denni34 in forum Access
    Replies: 4
    Last Post: 10-23-2015, 09:03 AM
  3. Referencing a local drive for all users
    By LonghronJ in forum Modules
    Replies: 7
    Last Post: 08-26-2015, 07:12 AM
  4. saving data from Attachment field to local drive
    By saleemsadique in forum Access
    Replies: 5
    Last Post: 01-21-2014, 06:52 PM
  5. shared DB on local drive
    By mike02 in forum Access
    Replies: 1
    Last Post: 05-20-2013, 01:54 PM

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