1. Computing

Discuss in my forum

Mike Chapple

Opening PDF Files Within Microsoft Access

By December 20, 2009

Follow me on:

In a recent forum message, Redwings2010 wrote:

"My boss wants me to create a form using Access 2007 that would open a specific PDF file to view in the form. He doesn't want to click on and view the PDF file outside Access. Is that possible?"

Can you help? Interested in solutions to the same problem? Visit the About Databases forum and join the discussion!
Comments
December 30, 2009 at 10:57 am
(1) Guy says:

Yes, it’s possible. You may achieve this with the use of hyperlinks.

Here’s how:

1. In a table add a field with the following attributes:
Field Name: LinkToPdf (you may actually name the field as you like)
Data Type: Hyperlink

2. Create your form
With the Form Wizard, make sure a TextBox is generated for the LinkToPdf field.
If the form is already existing, open it in Design View, then drag and drop the LinkToPdf field from the Field list to the Detail area of your form.

3. Open the resulting form, in Form view. You may now enter the file path leading to the file, preceeded with the file protocol standard prefix (file://)
e.g. file://c:\filename.pdf

This is a case where the user would have to manually enter the hyperlink. Clicking the TextBox value will open the pdf.

Note that you may also do the same with web site addresses by entering a link in the LinkToPdf field using the http protocol:
e.g. http://www.microsoft.com/

Here clicking the value will result in displaying the Microsoft home web page.

If the pdf link does not change from one record to the other (e.g. link to a fixed web site here Microsoft), you may want to preassign a value to the LinkToPdf, using the Default Value property of the TextBox, and use the Locked property to make it Read-Only, i.e. non-modifiable by the user.

Furthermore, if you form represents, let’s say, an item in a catalog (e.g. ItemNo 123-456), you may display the path to a pdf datasheet file for this item.

In this case, you will use Visual Basic statements in your form’s code to dynamically build the path’s character string based on the value of another field, i.e. the item number ItemNo.
e.g. file://c:\123-456.pdf.

Hypelink fields open up a wide range of new possibilities for Access forms. A great feature!

Hope this helps!

Guy

June 3, 2011 at 12:12 pm
(2) Dino says:

I would like to link (hyperlink) to an existing PDF from within a MS Access 2010 Report vs a MS Access form as described in the link above. When I create a form it appears work properly as u described. When I used the same process within a report it does not appear to work. I have a table field with many different values. Would like to be able (in a report) to be able to pop up the selected PDF. Appreciate the help).

January 5, 2012 at 2:13 pm
(3) Mark says:

I’m working on a project where files are scanned to a share drive. The scan files are named by ProjectID such as: 12345678.pdf. I have created a hyperlink from a form: “S:\SharedFolder\”+[ProjectID]+”.pdf” hat incorporates the ProjectID and opens the PDF.

Now I would like to set it up such that when the form with the link is opened and the pdf has not been scanned to the shared folder that a text box says “Document not yet scanned.”

How do I do this?

February 14, 2013 at 1:18 am
(4) MinusZero says:

I found an easy way.

Create a Button

In the Hyperlink Address Property add your file address eg C:\myfile.pdf

Save

Click the button and the file “myfile.pdf” will open up in acrobat.

October 8, 2013 at 8:48 pm
(5) Casey says:

The question says: ” He doesn’t want to click on and view the PDF file outside Access. Is that possible?” . The solution above does not provide an unbound control to view the PDF file. If you add a Web Browser control and set source control to LinkToPdf the embedded browser will navigate to the PDF specified. One could use a query to fill the LinkToPdf with valid links, then you would be able to view a different PDF for each record.

December 13, 2013 at 10:41 am
(6) Luis says:

Hi,

I’m wondering if there is a way to do something similar but using link to pages with in the document?

Like clicking a link “Product details” in page #1 and going to that product detail page in page #30.

Please help!

This have been pretty helpful! thank you.

Best,

December 19, 2013 at 8:30 am
(7) Fruz says:

@Luis

Did you find a solution to your problem. I want to do the same.

February 24, 2014 at 11:08 pm
(8) Fiona says:

Thanks a bunch for sharing this with all people you really understand what you
are speaking approximately! Bookmarked. Please also discuss with
my web site =). We can have a hyperlink alternate arrangement between us

March 12, 2014 at 3:01 am
(9) Click here says:

Exactly what a huge review relating to net comfort ! I definitely resisted with viruses not to mention Trojans before I initiated working with all instructions . Given that I’m utilizing VIPRE Antivirus Software , nonetheless , I certainly not receive any sort of computer viruses .

March 14, 2014 at 9:18 am
(10) Deena says:

Hi, I would like to subscribe for this web site to take most recent updates, so where can i do it please assist.

March 26, 2014 at 9:10 pm
(11) Hosted Exchange Solution says:

Its like you read my mind! You appear to know a lot about this, like you wrote the book in it or something.

I think that you could do with a few pics to drive the
message home a bit, but instead of that, this is great blog.

A fantastic read. I’ll definitely be back.

April 4, 2014 at 9:50 pm
(12) mkgseo-com.pl says:

Do you mind if I quote a couple of your articles as
long as I provide credit and sources back to your blog?
My blog is in the exact same niche as yours and my visitors would truly
benefit from some of the information you provide here. Please let
me know if this alright with you. Many thanks!

April 9, 2014 at 10:03 am
(13) Samuel says:

I want to open the PDF file and goto a specific bookmark… It´s posible

April 16, 2014 at 10:50 am
(14) Best Costa Rica marlin fishing says:

For fishing equipment, be careful when casting your
fishing tackle because it can catch up with another person or any other object that can be
a cause of accidents. By attracting fish, and getting them to strike, you’re well on your way to
becoming a better fisherman. During a fishing trip in the ocean, the fact remains that you just don’t have an idea of
the things you could face.

Leave a Comment

Line and paragraph breaks are automatic. Some HTML allowed: <a href="" title="">, <b>, <i>, <strike>

©2014 About.com. All rights reserved.