Opening PDF link in Access

M

Melissa

Hello,

I am trying to attach PDFs to records in access. I thought I could use the
open application command on a form by using the string

Private Sub Command65_Click()
On Error GoTo Err_Command65_Click

Dim stAppName As String

stAppName = "acrobat.exe k:\policies"
Call Shell(stAppName, 1)

Exit_Command65_Click:
Exit Sub

Err_Command65_Click:
MsgBox Err.Description
Resume Exit_Command65_Click

End Sub

but it keeps saying file not found. What am I missing? please help.
 
D

Douglas J. Steele

You don't seem to have given a file name, just a folder name.

If "policies" is supposed to be a PDF document and not a folder, try

stAppName = "acrobat.exe k:\policies.pdf"

Alternatively (and perhaps better) would be

Private Sub Command65_Click()
On Error GoTo Err_Command65_Click

Dim stAppName As String

stAppName = "k:\policies.pdf"
Application.FollowHyperlink stAppName

Exit_Command65_Click:
Exit Sub

Err_Command65_Click:
MsgBox Err.Description
Resume Exit_Command65_Click

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Previewing a report 7
Acrobat Distiller 1
Access 2003 6
Opening a specific Word file 3
switchboard 3
Using Null in an Event Procedure 2
Using ntBackup 3
Opening another Access DB from a Form Button 4

Top