Link to home
Start Free TrialLog in
Avatar of stephenlecomptejr
stephenlecomptejrFlag for United States of America

asked on

open up an adobe document in Access

Private Sub Cutsheets_DblClick(Cancel As Integer)
   
End Sub

In the body of the above code, what VBA can I use to open up a .pdf document?
SOLUTION
Avatar of tbsgadi
tbsgadi
Flag of Israel image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
If you have the path stored in afield you can use code something like this"
Private Sub Cutsheets_DblClick(Cancel As Integer)

Me.Label1.HyperlinkAddress = Me.AttachDoc
      Me.Label1.Hyperlink.Follow
End Sub
Avatar of Jim Horn
Hi stephenlecomptejr,

The above answers are correct.  There's no 'pdf-specific' way to just open a pdf file within Access, so a hyperlink works fine.  You could also execute a Shell() statement in code, but hyperlinks work the same.

Hope this helps.
-Jim
Using the Shell statement...

'Below line goes in declarations on top of any code module
Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hWnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long

'Use this single line to open up an URL or a file
Call ShellExecute(0&, vbNullString, sURL, vbNullString, vbNullString, vbNormalFocus)

'sURL for a web URL, otherwise any path/file/app to open up any app.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of stephenlecomptejr

ASKER

Can you expound on the above a little bit?

I'm going to have the path stored in a field called Cutsheets.
It's the name of a textbox on a datasheet form.
So when they double-click on the datasheet form it will pull up Me.[Cutsheets]
So how do I convert the above coding to have it pull up what's in Me.[Cutsheets]
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial