Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Eliminating "Save PDF As" Dialogue when printing to PDF.

Status
Not open for further replies.

dandot

Programmer
Jul 19, 2005
53
CA
I am currently running a handful of access reports, that are defaulted to print to "Adobe PDF" using the page setup feature.

When I print the reports, I get a "save PDF As" dialogue before they are printed. I would like to have this feature removed and automated to eliminate user interaction.

I tried using the basSaveAsPDF module found in the FAQ however I still get this dialogue.

Does anyone have suggestions on how I can have this done. My code is below.

Thank you!


Private Sub cmdCreateAssertions_Click()

If tLE_Assertion Then
stDocName = "rpt_LEGAL"
DoCmd.OpenReport stDocName, acViewNormal
DoCmd.Close acReport, stDocName, acSaveNo
End If

If tLOB_Assertion Then
stDocName = "rpt_LOB"
DoCmd.OpenReport stDocName, acViewNormal
DoCmd.Close acReport, stDocName, acSaveNo
End If

If tSAO_Assertion Then
stDocName = "rpt_SAO"
DoCmd.OpenReport stDocName, acViewNormal
DoCmd.Close acReport, stDocName, acSaveNo
End If

If tSBU_Assertion Then
stDocName = "rpt_SBU"
DoCmd.OpenReport stDocName, acViewNormal
DoCmd.Close acReport, stDocName, acSaveNo
End If
'Else
'GoTo ExitHere
'End If

ExitHere:
Display_Message ""
Exit Sub

HandleErr:
Select Case Err
Case Else
MsgBox "cmdCreateAssertions_Click " & Err & ": " & Err.Description
Resume ExitHere
End Select

End Sub
 
i use this module and have no issues with it what you need to do is to call the module by using the following method

Call SaveReportAsPDF("REPOR NAME", "PATH & FILENAME .pdf")

which i have updated you code that you provided, i hope this helps, if not please let me know what the issue is.

Code:
Private Sub cmdCreateAssertions_Click()
     
    If tLE_Assertion Then
	Call SaveReportAsPDF("rpt_LEGAL", "rpt_LEGAL.pdf")
    End If
   
    If tLOB_Assertion Then
	Call SaveReportAsPDF("rpt_LOB", "rpt_LOB.pdf")
    End If
   
    If tSAO_Assertion Then

	Call SaveReportAsPDF("rpt_SAO", "rpt_SAO.pdf")
    End If
  
   If tSBU_Assertion Then
	Call SaveReportAsPDF("rpt_SBU", "rpt_SBU.pdf")
     End If
'Else
   'GoTo ExitHere
'End If

ExitHere:
Display_Message ""
    Exit Sub
   
HandleErr:
Select Case Err
Case Else
    MsgBox "cmdCreateAssertions_Click " & Err & ": " & Err.Description
    Resume ExitHere
End Select

End Sub


 
Hi M8KWR,

Thank you for your reply. I get the following message:

Run-time error '2002':
You must install a printer before you design, print or preview"


I believe it has something to do with me using network printers. Any ideas?
 
have you got PDFWriter installed on the computer???

If you ahve the full version of acrobat, you need to customise the installation to select to install PDFWriter.

Hope this helps.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top