Export to PDF (1 Viewer)

2wistd

Registered User.
Local time
Today, 11:24
Joined
Jan 17, 2013
Messages
66
Code:
DoCmd.OutputTo acOutputReport, "Breakdown Hourly", acFormatPDF, "Hourly Breakdown - " & Format(Now, "hh:mm") & ".pdf", True, "", acExportQualityPrint

What is wrong with this code? Each time I push the button it shows the popup for microseconds, then does nothing. If I reduce it to:

Code:
DoCmd.OutputTo acOutputReport, "Breakdown Hourly", acFormatPDF, "Hourly Breakdown.pdf", True, "", acExportQualityPrint

I have no problem at all. I've also used "Time", and "Date", with no luck.
 

SOS

Registered Lunatic
Local time
Today, 11:24
Joined
Aug 27, 2008
Messages
3,517
You can't use colons in file names.


Use this:

DoCmd.OutputTo acOutputReport, "Breakdown Hourly", acFormatPDF, "Hourly Breakdown - " & Format(Now, "hh_mm") & ".pdf", True, , acExportQualityPrint

And don't put "" in parameters that aren't passing any values. Just leave it blank between the commas.
 

2wistd

Registered User.
Local time
Today, 11:24
Joined
Jan 17, 2013
Messages
66
Awesome, works like a charm.
 

Users who are viewing this thread

Top Bottom