Printing report to PDF file

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Dear Sirs
I would like to print my reports automatically to an PDF file, without
changing my Printer Options upfront.
I created a command button to print those records - but up-to-now the
records are going straight to the printer. How can I change the code so that
they are printed to a PDF file?

Here is the normal code maybe someone can change it to that what I need:

Private Sub Command41_Click()
On Error GoTo Err_Command41_Click

Dim stDocName As String

stDocName = "endofmonthstatementbie30preport"
DoCmd.OpenReport stDocName, acNormal
stDocName = "endofmonthstatementbie30"
DoCmd.OpenReport stDocName, acNormal
stDocName = "endofmonthstatementclientsnonpool"
DoCmd.OpenReport stDocName, acNormal

Exit_Command41_Click:
Exit Sub

Err_Command41_Click:
MsgBox Err.Description
Resume Exit_Command41_Click

End Sub
 
You must change the specific printer for that report to the PDF printer. Do
it in the report's Design View and save the report with that printer
selected.
 
That would be easy and fine but I cannot do it because the report should be
printed to a normal printer as well automatically. I would like that the
report is printed to PDF for my Web.
I have been told to the following code:

Private Sub Command63_Click()
On Error GoTo Err_Command63_Click

Dim stDocName As String

stDocName = "endofmonthstatementbie30preport"
DoCmd.OpenReport "endofmonthstatementbie30preport", acNormal
Application.Reports("endofmonthstatementbie30preport").Printer =
("Amyuni PDF Converter")
Application.Printers ("Amyuni PDF Converter")

Exit_Command63_Click:
Exit Sub

Err_Command63_Click:
MsgBox Err.Description
Resume Exit_Command63_Click

End Sub

The problem is that I get now an error message: Compile error / Type mismatch
Any idea how to correct this?
Thanks
Klaus
 
I get the error message in this line:
Application.Reports("endofmonthstatementbie30preport").Printer =("Amyuni PDF
Converter")
Is there a poosibility for you, with the information I provided, to change
the code?
Thanks Klaus
 
Back
Top