Solved

Link pdf file to record

Posted on 2014-02-12
4
464 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 4

Accepted Solution

by:
Jack Leach earned 500 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article describes two methods for creating a combo box that can be used to add new items to the row source -- one for simple lookup tables, and one for a more complex row source where the new item needs data for several fields.
Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

738 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