تفضل يا سيدي
Private Sub cmd_Show_PDF_Click()
On Error GoTo err_cmd_Show_PDF_Click
dim PDF_Name_Path As String
PDF_Name_Path = GetWinTemp & "\ImitatePDFPrintingLikeInOracleButFromMsAccess.pdf"
Debug.Print PDF_Name_Path
'delete the old file
Kill PDF_Name_Path
DoCmd.OutputTo acOutputReport, "REEport", acFormatPDF, PDF_Name_Path
' PauseTime = 1 ' Set duration.
' Start = Timer ' Set start time.
' Do While Timer < Start + PauseTime
' DoEvents ' Yield to other processes.
' Loop
Application.FollowHyperlink PDF_Name_Path
Exit Sub
err_cmd_Show_PDF_Click:
If Err.Number = 53 Then
'file does not exist
Resume Next
Else
MsgBox Err.Number & vbCrLf & Err.Description
End If
End Sub
جعفر