Converting access report to PDF in 2007

A

alathwell

Hello, I am running the followind code to directl convert acces report into
PDF format. The code work perfectly on one report but not on another. When
the first report is complet it opens acrobat allowing you to view the PDF
file. The code runs in both cases with no error messages, but the second
report just doesn't seem to complete and doesn't open acrobat.

The only difference between reports is the second report has an additional
subreport level.

This is the code i am using.

Select Case Me![QuoteTypeCheckFrame]

Case 1

strDoc = "rptLongQuote"
strfile = "C:\QuotesDatabase\SingleQuote.pdf"
DoCmd.OutputTo acOutputReport, strDoc, acFormatPDF, strfile, True

Case 2, 3

strDoc = "rptSeries"
strfile = "C:\QuotesDatabase\SeriesQuote.pdf"
DoCmd.OutputTo acOutputReport, strDoc, acFormatPDF, strfile, True

End Select

Any suggestions would be appreciated.

Regards

alathwell
 
A

alathwell

Hi Thanks for your response.

if I preview the report and then manually email vial tool bar and select PDF
format it works fine.
When running by code momentarily the Printing - Now Outputing window
appears for a very short space of time, then nothing happens

Regards

alathwell

June7 via AccessMonster.com said:
First, just as a test, have code open the report in Preview then send the
open report to PDF. If successful, then maybe make standard procedure.
If fails, confirm whether the subform is interfering. Make a copy of the
report, delete the subform, let code PDF.
Hello, I am running the followind code to directl convert acces report into
PDF format. The code work perfectly on one report but not on another. When
the first report is complet it opens acrobat allowing you to view the PDF
file. The code runs in both cases with no error messages, but the second
report just doesn't seem to complete and doesn't open acrobat.

The only difference between reports is the second report has an additional
subreport level.

This is the code i am using.

Select Case Me![QuoteTypeCheckFrame]

Case 1

strDoc = "rptLongQuote"
strfile = "C:\QuotesDatabase\SingleQuote.pdf"
DoCmd.OutputTo acOutputReport, strDoc, acFormatPDF, strfile, True

Case 2, 3

strDoc = "rptSeries"
strfile = "C:\QuotesDatabase\SeriesQuote.pdf"
DoCmd.OutputTo acOutputReport, strDoc, acFormatPDF, strfile, True

End Select

Any suggestions would be appreciated.

Regards

alathwell
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top