Solved

Link pdf file to record

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

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How can I create a table in a linked database, in VB? 7 17
How autopopulate number field with 2 different criteria 9 51
Sub Reports 8 21
Query design issue 2 22
Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
It took me quite some time to sort out all the different properties of combo and list boxes available from Visual Basic at run-time. Not that the documentation is lacking: the help pages are quite thorough and well written. The problem was rather wh…
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…
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 …

911 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

18 Experts available now in Live!

Get 1:1 Help Now