Avatar of Thomas Zucker-Scharff
Thomas Zucker-ScharffFlag for United States of America

asked on 

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

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.

User generated image
DatabasesPDFMicrosoft AccessVBAVisual Basic Classic

Avatar of undefined
Last Comment
Thomas Zucker-Scharff
Avatar of David Johnson, CD
David Johnson, CD
Flag of Canada image

no they can use the access runtime engine https://www.microsoft.com/en-ca/download/details.aspx?id=50040

you can change the trusted locations in internet explorer.
Avatar of Thomas Zucker-Scharff



Thanks for answering so quickly.  How does changing the trusted locations using IE affect trusted documents in Access?
Avatar of John Tsioumpris
John Tsioumpris
Flag of Greece image

Blurred text
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of Dale Fye
Dale Fye
Flag of United States of America image

1.  as David said, you can download the Access Runtime from here.  This will allow you to run the Access application from computers which do not have Access installed as part of the Office product they are using.  That link takes you to the Office 365 version of the runtime, but I would encourage you to get the runtime associated with whatever version of Office you are developing in.

2. The second issue is the trusted location issue.  From whatever version of Office you are using, you should be able to open Excel, open the Excel Options dialog box, and then select the "Trust Center" option.  Once there select the Trust Center Settings, then Trusted Locations, and add the path to where you are installing the Access application on users computers using the Add New Location button.

Good luck
Avatar of Thomas Zucker-Scharff



I haven't tried the runtime yet, but I did try the trust center issue in #2.  I still get the sam eissue.  The error says it is because it is a hyperlink (same error0.  Could it be because I am running the DB from a stick?
Avatar of Thomas Zucker-Scharff


Thanks to all who helped.  I now have my solution - on to the next adventure/problem (creating an interactive report generator in access so that someone can choose from the fields they want to generate a report).
Microsoft Access
Microsoft Access

Microsoft Access is a rapid application development (RAD) relational database tool. Access can be used for both desktop and web-based applications, and uses VBA (Visual Basic for Applications) as its coding language.

Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews


IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo