Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Link pdf file to record

Posted on 2014-02-12
4
Medium Priority
?
476 Views
Last Modified: 2014-02-17
Using Access 2010 or 2013
I would like to be able to bring up a file (image or pdf) on a record when clicking on a field.
On a report that lists several certifications for each employee I would like to bring up the specific scanned certification file or image for that listed cert record.
 How best to accomplish this?

Thanks
0
Comment
Question by:zkoda
  • 2
4 Comments
 
LVL 4

Accepted Solution

by:
Jack Leach earned 2000 total points
ID: 39854487
Store the path to the PDF in a text field in your table.
Create a textbox to show the path/field value.
Set the textbox IsHyperlink property to True.
That should do, but you might have to write a bit of code in the Click event of the control also:

Private Sub MyPDFPath_Click()
  Application.FollowHyperlink Me!MyPDFPath
End Sub

Open in new window


hth
0
 
LVL 21
ID: 39854553
Linking a file to a record is easy. Getting the link to work on a report is not so easy. I generally use a form for this.

I have created a couple of  example:

1) Document Links

This is a basic example of how to store the path to  a file and also be able to view the file. You can browse using the standards windows common dialog to select the file. You can view the file using the application defined with the Windows File Associations. It uses the ShelExec API to open the file. It does not use the .Followhyperlink  method.

This example is a continuous form that could easily be used as a sub form to attach multiple documents to a record.

2) Document Links 2

his is an update to the basic example of how to store the path to a file and also be able to view the file. You can browse using the standards windows common dialog to select the file. You can view the file using the application defined with the Windows File Associations. It uses the ShelExec API to open the file. It does not use the .Followhyperlink  method.

This example is a continuous form that could easily be used as a sub form to attach multiple documents to a record.

***** Because it doesn't use the hyperlink data type, this new version stores the path in a way that allows the folder to be easily moved.
0
 

Author Comment

by:zkoda
ID: 39859852
HiTech

I appreciate your solution but I'm having problems plugging it in concerning control source.  I a newbie and will certainly pose this as a new question if you wish.
Don't know how much I need to put in my sample form of which is attached.  Can I do away with the most of the fields and just leave path ?

Thanks for your help and let me know if I should send another post.
SampleDB.accdb
0
 
LVL 21
ID: 39866463
To use in your own application you can import the code module. The copy and past the two command buttons and the VBA code for each and  Edit the control names to match yours.

You can do away with any fields you feel you don't need other than the path.
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

926 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question