Solved

Link pdf file to record

Posted on 2014-02-12
4
466 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

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

622 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