Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need to attach PDF files to Access Database

Status
Not open for further replies.

Bobford

IS-IT--Management
Dec 1, 2006
35
0
0
US
I am trying to create a PDF link that will pull up the correct file for a particular record. I thought I had it with the script below:


Dim stAppName As String
Dim Filepath As String
Const cstrPath As String = "\\mas200server\mas_pdf_files\"
Filepath = cstrPath & [ItemNumber] & ".pdf"
stAppName = "C:\Program Files\Adobe\Reader 8.0\Reader\AcroRd32.exe "
Call Shell(stAppName, 1)


Now it will launch Acrobat after clicking my link but it claims that the file is not found for the PDF. It is definitely in the directory and named exactly the item number for the record I am clicking but it's still not working.

Any ideas as to what I am doing wrong??

Any help is GREATLY appreciated.

Bob
 
Why not simply this ?
Application.FollowHyperlink "\\mas200server\mas_pdf_files\" & [ItemNumber] & ".pdf"

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Thank you! I hope it is that easy. Should I put this in a particular spot or just replace my code I used with this single line?

 
Try changing:

Call Shell(stAppName, 1)

to:

Call Shell(stAppName & " " & Filepath, 1)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top