473,395 Members | 1,915 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

How to automatically run DoCmd.OutputTo on daily basis

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:

Expand|Select|Wrap|Line Numbers
  1. Sub Report_Export()
  2. If Format(Now(), "hh:mm") = "12:00" Then
  3. 'Now() = Current Date/Time
  4. 'Time set for 12:00 noon
  5. DoCmd.OutputTo acOutputReport, "SSP&A ROADMAP", acFormatPDF, "http://(web server address)/ez/Documents/SSP&A%20ROADMAP.pdf", False, , , 0
  6. DoCmd.OutputTo acOutputReport, "Ready to Launch Report_EZLC", acFormatPDF, "http://(web server address)//ez/Documents/Ready%20to%20Launch%20Report_EZLC.pdf", False, , , 0
  7. DoCmd.OutputTo acOutputReport, "Ready to Launch Report_PFIT", acFormatPDF, "http://(web server address)//ez/Documents/Ready%20to%20Launch%20Report_PFIT.pdf", False, , , 0
  8. End If
  9. End Sub
I'd appreciate guidance from anyone who can help me.

Regards,

JM
Aug 1 '08 #1
2 3727
ADezii
8,834 Expert 8TB
  1. Set the Timer Interval Property of the Form to 60000 (1 minute).
  2. Place your code in the Timer() Event of the Form.
  3. Every Minute the code in the Timer () Event will be executed, and when it is exactly !2:00 Noon, the criteria will be met, and the OutPutTo Actions will be initiated.
  4. P.S. - The 'Database' and 'Form' must be 'Opened'.
Aug 2 '08 #2
NeoPa
32,556 Expert Mod 16PB
Alternatively (perhaps a little more complex), design a database that opens a particular form automatically on opem. The code in the OnOpen event of the form does the work you need done and then closes the application.

Use standard Windows sceduling to invoke the database at noon every day and everything should work as required.
Aug 10 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Victor Kaiser | last post by:
I am using DoCmd.OutputTo to allow users to save Access reports in snapshot format or other desired formats. Once the user selects the desired format and clicks "OK", a dialog box appears that...
2
by: deko | last post by:
This code is behind a button that exports the contents of a query ("qryXL_Tx") to an Excel spreadsheet. It works fine the first time, but will not run a second time. When I go to look at my...
0
by: Frank Barnhart | last post by:
We have an application which runs Access under automation. With Access 97, the app included this line to send a report to a text file: myAccessObject.DoCmd.OutputTo acOutputReport, ,...
0
by: Robert Langen | last post by:
I'm calling an Access XP application from an Outlook XP appointment form. Everything works, but the lines DoCmd.OutputTo acOutputReport, "testreport", acFormatRTF, "c:\test.rtf", False Docmd.Quit...
4
by: tmountjr | last post by:
I've got a user who's trying to export a text file with unicode formatting. When he exports it as straight ascii, some of the foreign characters (mostly just accent marks and the like - no...
7
by: MLH | last post by:
A97 has menu options that support exporting table data to ms excel data file format. Is this easily implemented from within code? Any examples? I looked in A97 HELP for the TransferSpreadsheet...
1
by: Ryan | last post by:
Hello. I was hoping that someone may be able to assist with an issue that I am experiencing. I have created an Access DB which imports an Excel File with a particular layout and field naming. ...
1
by: Simon | last post by:
Dear reader, With the DoCmd.OutputTo ...... you have the possibility to write a report to an external location. In case the external location is an existing file the DoCmd is not...
16
by: g diddy | last post by:
Hi, I have used the Docmd.outputto function in various places in my code but for some reason all code that comes afterwards, even msgbox doesn't show. I was just wondering if there is anything that...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.