B
BlueWolverine
Hello,
MS ACCESS 2003 on XP PRO.
I want to print documents to PDF, which I can do from my computer using the
printer "ADOBE PDF."
I have code that worked once to print the report to pdf, but now it's not
working.
Here's the short version of the code
DoCmd.OpenReport "r_SingleChecklist", acViewPreview
DoCmd.OpenReport "r_SingleChecklistSD", acViewPreview
Set rpt = Reports!r_SingleChecklist
Set rpt_not = Reports!r_SingleChecklistSD
'Open report
DoCmd.OpenReport rpt.Name, acViewPreview
'change Printer
Call m_Change_Printer(rpt, "Adobe PDF")
'Print Report
DoCmd.PrintOut acPages, , , acHigh, 1
Right now it fails on DOCMD.PRINTOUT.
The message is that the command isn't available right now.
Also, occasionally my change printer algorithm doesn't actually change the
printer.
Sub m_Change_Printer(r_report As Report, str_Printer_Name As String)
Dim prt_Adobe As Printer, prt_loop As Printer
For Each prt_loop In Application.Printers
If prt_loop.DeviceName = str_Printer_Name Then
With prt_loop
Set prt_Adobe = prt_loop
End With
End If
Next prt_loop
Set r_report.Printer = prt_Adobe
End Sub
Any idea?
MS ACCESS 2003 on XP PRO.
I want to print documents to PDF, which I can do from my computer using the
printer "ADOBE PDF."
I have code that worked once to print the report to pdf, but now it's not
working.
Here's the short version of the code
DoCmd.OpenReport "r_SingleChecklist", acViewPreview
DoCmd.OpenReport "r_SingleChecklistSD", acViewPreview
Set rpt = Reports!r_SingleChecklist
Set rpt_not = Reports!r_SingleChecklistSD
'Open report
DoCmd.OpenReport rpt.Name, acViewPreview
'change Printer
Call m_Change_Printer(rpt, "Adobe PDF")
'Print Report
DoCmd.PrintOut acPages, , , acHigh, 1
Right now it fails on DOCMD.PRINTOUT.
The message is that the command isn't available right now.
Also, occasionally my change printer algorithm doesn't actually change the
printer.
Sub m_Change_Printer(r_report As Report, str_Printer_Name As String)
Dim prt_Adobe As Printer, prt_loop As Printer
For Each prt_loop In Application.Printers
If prt_loop.DeviceName = str_Printer_Name Then
With prt_loop
Set prt_Adobe = prt_loop
End With
End If
Next prt_loop
Set r_report.Printer = prt_Adobe
End Sub
Any idea?