troubleshooting Question

How to open a PDF from with MS Access and bypass the enable content prompt

Avatar of Thomas Zucker-Scharff
Thomas Zucker-ScharffFlag for United States of America asked on
DatabasesPDFMicrosoft AccessVBAVisual Basic Classic
6 Comments1 Solution48 ViewsLast Modified:
At the end of February I asked this question.  I have created an Access database to perform similar functions instead.  It is a file of type  .accdb.  I had wanted to distribute it so others would be able to use it but found out that MS Access databases can only be run on machines with a fully licensed version of Access (if that is not so, please correct me).  Anyway, My question is I want to open a PDF from within the database.  I have implemented the following code to do so.

Private Sub Command42_Click()
Dim strPath As String
strPath = "..\path-to-file\my-file.pdf"
Application.FollowHyperlink strPath
End Sub

I have made it so a form opens when the user opens the database, but the open pdf button, which fires that code, doesn't work unless the user closes the initial form and then enables content, at which point the form will open again.  But normally the user doesn't even know how to close the form without closing the database.

Is there any way to get the DB to open a pdf without having this problem?  Also once the content is enabled the user still sees the attached warning when opening the pdf, is there any way to stop that as well (my users are not all very computer savvy and will most likely balk at the security warning and get frustrated when the button to display a pdf doesn't work)?

Because of the nature of the data within the database, I am not at liberty to share it.

This is the warning every user sees when initially tryingto open a pdf after enabling content.
Join our community to see this answer!
Unlock 1 Answer and 6 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 6 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros