Solved

Link pdf file to record

Posted on 2014-02-12
4
458 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 500 total points
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

Complete Microsoft Windows PC® & Mac Backup

Backup and recovery solutions to protect all your PCs & Mac– on-premises or in remote locations. Acronis backs up entire PC or Mac with patented reliable disk imaging technology and you will be able to restore workstations to a new, dissimilar hardware in minutes.

Join & Write a Comment

When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

763 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now