Share via

How To OPEN PDF from Command Button

Anonymous
2011-05-17T16:03:24+00:00

I want to launch Adobe or (default PDF viewer) from a Form in Access.

Table does not contain the full path and file name so I created a Query combining MatlCertPDF: "K:\Material Certs"+[Vendor]+[Filename]

On Form I tried to create a button to launch PDF viewer but it's not working.

Private Sub Command39_Click()

Application.FollowHyperlink Me.MatlCertPDF

End Sub

"Runtime error 490.  Can't open specified file

What is missing?

Microsoft 365 and Office | Access | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

2 answers

Sort by: Most helpful
  1. Anonymous
    2011-05-17T17:51:57+00:00

    Good eyes. [Vendor] is a folder. The backslash in the filename field, a result of an index export from a scanning app.

    Example

    Vendor = Jump

    Filename = \889765-060426.PDF

    K:\matl certs\jump\889765-060426.PDF

    But upon further investigation I see the filename in the DB does not match the actual filename.  Hmmm seems the index app has added spaces around the - in the file name.  So perhaps this is a case of checking my work.

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2011-05-17T16:39:07+00:00

    Is VENDOR a folder?  If so you are missing a backslash.

    Was this answer helpful?

    0 comments No comments