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: - 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
I'd appreciate guidance from anyone who can help me.
Regards,
JM
2 3727 - Set the Timer Interval Property of the Form to 60000 (1 minute).
- Place your code in the Timer() Event of the Form.
- 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.
- P.S. - The 'Database' and 'Form' must be 'Opened'.
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.
Sign in to post your reply or Sign up for a free account.
Similar topics
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...
|
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...
|
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, ,...
|
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...
|
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...
|
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...
|
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. ...
|
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...
|
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...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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...
|
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...
|
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...
|
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...
|
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,...
| |