We upgraded our adobe acrobat on a computer at work. I added in the new file path to the new exe file. When we go to run the double click event, it opens the new adobe but brings up error file cannot be found. This script has been up and running for a while. Anybody know of any issues in this script or is it just an adobe issue. This pdf file is over a network.
Code:
Private Sub PO_DblClick(Cancel As Integer)
POV = Me!PO
If Len(POV) = 2 Then POV = "0000" & POV
If Len(POV) = 3 Then POV = "000" & POV
If Len(POV) = 4 Then POV = "00" & POV
If Len(POV) = 5 Then POV = "0" & POV
If IsNull(Me![ID]) = True Then
End
End If
idVar = DLookup("ID", "PO-Details", "Sheet1ID = " & Me![ID])
If IsNull(idVar) = True Then
strfile = Dir("C:\PackingLists\" & POV & ".pdf")
If Len(strfile) > 0 Then
If IsNull(DLookup("PO", "PO-List", "PO = " & Me!PO)) = True Then
MsgBox "PO " & POV & " does not exsist in system. Can NOT open size/color form"
End
Else
FileCopy "C:\PackingLists\" & POV & ".pdf", "K:\Teams and Projects\Receiving\PackingLists\PL-" & Me!PO & "-" & Me![ID] & ".pdf"
Kill "C:\PackingLists\" & POV & ".pdf"
DoCmd.SetWarnings False
DoCmd.RunSQL "INSERT INTO [PO-Details] ( Sheet1ID, PO, SZ1, SZ2, SZ3, SZ4, SZ5, SZ6, SZ7, SZ8, SZ9, SZ10 ) SELECT " & Me!ID & " AS Sheet1ID, [PO-List].PO, [PO-List].SZ1, [PO-List].SZ2, [PO-List].SZ3, [PO-List].SZ4, [PO-List].SZ5, [PO-List].SZ6, [PO-List].SZ7, [PO-List].SZ8, [PO-List].SZ9, [PO-List].SZ10 FROM [PO-List] WHERE ((([PO-List].PO)=" & Me!PO & "));"
DoCmd.OpenQuery "PackingList-AddCCDetails-CommonCarrier"
DoCmd.SetWarnings True
End If
Else
MsgBox "PO " & Me![PO] & " does not have a packing list is not on file."
End
End If
End If
DoCmd.SetWarnings False
DoCmd.OpenQuery "PackingList-CaptureUnitsOrdered-CommonCarrier"
DoCmd.SetWarnings True
DoCmd.OpenForm "X-Ab-CCEntry-Main", , , "Sheet1ID = " & Me![ID]
idVar = Me!ID
poVar = Me!PO
folder = "K:\Teams and Projects\Receiving\PackingLists\"
If Len(poVar) = 2 Then poVar = "0000" & poVar
If Len(poVar) = 3 Then poVar = "000" & poVar
If Len(poVar) = 4 Then poVar = "00" & poVar
If Len(poVar) = 5 Then poVar = "0" & poVar
sPath = folder & "PL-" & poVar & "-" & idVar & ".pdf"
ChDir ("K:\Teams and Projects\Receiving\PackingLists")
strfile = Dir("K:\Teams and Projects\Receiving\PackingLists\PL-" & poVar & "-" & idVar & ".pdf")
If Len(strfile) > 0 Then
If FileOrDirExists("C:\Program Files\Adobe\Reader 9.0\Reader\AcroRd32.exe") Then
path = "C:\Program Files\Adobe\Reader 9.0\Reader\AcroRd32.exe"
End If
If FileOrDirExists("C:\Program Files\Adobe\Reader 8.0\Reader\AcroRd32.exe") Then
path = "C:\Program Files\Adobe\Reader 8.0\Reader\AcroRd32.exe"
End If
If FileOrDirExists("C:\Program Files\Adobe\Acrobat 6.0\Acrobat\Acrobat.exe") Then
path = "C:\Program Files\Adobe\Acrobat 6.0\Acrobat\Acrobat.exe"
End If
If FileOrDirExists("C:\Program Files\Adobe\Reader 11.0\Reader\AcroRd32.exe") Then
path = "C:\Program Files\Adobe\Reader 11.0\Reader\AcroRd32.exe"
End If
If FileOrDirExists("C:\Program Files\Adobe\Acrobat 8.0\Acrobat\Acrobat.exe") Then
path = "C:\Program Files\Adobe\Acrobat 8.0\Acrobat\Acrobat.exe"
End If
X = Shell(path & " " & sPath, vbNormalFocus)
End If
End Sub
Thanks,
Nick