MS Access 2007 - Link to open a PDF

I have a form that has a graphic icon on the form. When the user click on the graphic icon I want to open a PDF file that I have stored in a subdirectory.

I would like someone to tell me the VBA code to use to open a PDF from the click event of an graphic icon on a form.

Thanks in advance for your assistance.
Lou DufresneIT Business Analyst CSM / Project ManagerAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

In form Design View, add an Unbound Object Frame. In the wizard, select Create from File, check the Link checkbox, click Browse..., and navigate to your .pdf file. Check the Display as Icon checkbox if you want to see a generic pdf icon, or leave it clear if you want to see your file contents. Click OK. Still in Design View, select your new control and set its Enable property to Yes.
If you do it this way, you do not need VBA at all.
Enabled property
If you are looking for the actual code try this.
Shell "pdfApplicationPath pdfFilePath" , vBnormalFocus
Where pdfApplicationPath is the the location of the Adobe Reader program and pdfFilePath is the path and filename of the PDF you want to open
Shell "C:\program files\Adobe\Reader 9.0\AcroRd32.exe c:\Documents and Settings\Username\My Documents\MyPDF.pdf"

followed by the filename you want to open.
C:\Program Files\Adobe\Acrobat 6.0\Reader\AcroRd32.exe c:\temp\mypdf.pdf

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
The example above should have read
Shell "C:\program files\Adobe\Reader 9.0\AcroRd32.exe c:\Documents and Settings\Username\My Documents\MyPDF.pdf", vbNormalFocus
Lou DufresneIT Business Analyst CSM / Project ManagerAuthor Commented:
Both solutions worked fine. The solution that fit best for my needs was nicsaint's solution.

Thanks both of you for your expert assistance

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.