Hello all. I'm trying to open pdf files from access. The files are in different folders depending on the type they are. Everything works fine the first time I run it, but if I run it again without closing Acrobat nothing happens. I would like to be able to open multiple pdf's or one after the other. Here is what I have so far.
Private Sub view_Click()
Dim strValue
Dim retVal
Dim cmd As String
Dim fullPath As String
Dim strFolder As String
Dim strTechSelector
strTechSelector = [Tech Code]
'choose the folder depending on the value in the tech code column
Select Case strTechSelector
Case "UC"
strFolder = "UrethanePDF\"
Case "DC"
strFolder = "DWGEMIPDF\"
Case "PC"
strFolder = "PlasticsPDF\"
Case "TC"
strFolder = "TextilesPDF\"
End Select
'set strValue to the tech code column plus the number column example dc + 4609 is dwg DC4609
strValue = [Tech Code] & [NUMB]
'fullPath is the path to the dwgs
'1* is a naming and revision
fullPath = "U:\EDMIndex\PROJECTS\" & strFolder & strValue & "1*.pdf"
cmd = Chr(34) & "C:\Program Files\Adobe\Acrobat 6.0\Acrobat\Acrobat.exe" & Chr(34) & fullPath & Chr(34)
retVal = Shell(cmd, vbNormalFocus)
End Sub
Thank you for your time.
Private Sub view_Click()
Dim strValue
Dim retVal
Dim cmd As String
Dim fullPath As String
Dim strFolder As String
Dim strTechSelector
strTechSelector = [Tech Code]
'choose the folder depending on the value in the tech code column
Select Case strTechSelector
Case "UC"
strFolder = "UrethanePDF\"
Case "DC"
strFolder = "DWGEMIPDF\"
Case "PC"
strFolder = "PlasticsPDF\"
Case "TC"
strFolder = "TextilesPDF\"
End Select
'set strValue to the tech code column plus the number column example dc + 4609 is dwg DC4609
strValue = [Tech Code] & [NUMB]
'fullPath is the path to the dwgs
'1* is a naming and revision
fullPath = "U:\EDMIndex\PROJECTS\" & strFolder & strValue & "1*.pdf"
cmd = Chr(34) & "C:\Program Files\Adobe\Acrobat 6.0\Acrobat\Acrobat.exe" & Chr(34) & fullPath & Chr(34)
retVal = Shell(cmd, vbNormalFocus)
End Sub
Thank you for your time.
Last edited: