Greetings,
I have several Access 2007 reports that I regularly export to individual PDF flat files on a web server. I've successfuly created a module sub to export the reports using the DoCmd.OutputTo Macro action, but I can't seem to figure out how to run the macro automatically.
I can succesfully run the macro below manually (without the IF statements), but have yet to make it work with the IF statement. Ideally, the macro will run automatically at 12:00 noon daily whether or not I have the database open (preferably not).
Here's the code for what I have so far:
I'd appreciate guidance from anyone who can help me.
Regards,
JM
I have several Access 2007 reports that I regularly export to individual PDF flat files on a web server. I've successfuly created a module sub to export the reports using the DoCmd.OutputTo Macro action, but I can't seem to figure out how to run the macro automatically.
I can succesfully run the macro below manually (without the IF statements), but have yet to make it work with the IF statement. Ideally, the macro will run automatically at 12:00 noon daily whether or not I have the database open (preferably not).
Here's the code for what I have so far:
Code:
Sub Report_Export() If Format(Now(), "hh:mm") = "12:00" Then 'Now() = Current Date/Time 'Time set for 12:00 noon DoCmd.OutputTo acOutputReport, "SSP&A ROADMAP", acFormatPDF, "http://(web server address)/ez/Documents/SSP&A%20ROADMAP.pdf", False, , , 0 DoCmd.OutputTo acOutputReport, "Ready to Launch Report_EZLC", acFormatPDF, "http://(web server address)//ez/Documents/Ready%20to%20Launch%20Report_EZLC.pdf", False, , , 0 DoCmd.OutputTo acOutputReport, "Ready to Launch Report_PFIT", acFormatPDF, "http://(web server address)//ez/Documents/Ready%20to%20Launch%20Report_PFIT.pdf", False, , , 0 End If End Sub
Regards,
JM
Comment