Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need to run an event procedure every 24 hrs at a certain time

Status
Not open for further replies.

cabletek

Technical User
Oct 11, 2002
14
US
I have a textimport event that I need to run once a day at a specified time (to be determined). How is the most efficent way of doing it though the timer setting on a form? I know I'm going to have to leave that form open 24/7, or at least open it before the scheduled time. Ralph Solomon
Comcast Cable Communications
ralph_solomon@cable.comcast.com
 
look into "timer" in the help file. It might be easier, though, to use the windows timer to open a database that is made just for this purpose, so that it fires your code whenever it is open. It _will_ be difficult to reliably have this form open at the right time every day.

Jeremy =============
Jeremy Wallace
Designing, Developing, and Deploying Access databases since 1995.
 
If you are running Win98 or better, you can use the Task Scheduler that comes with it. It should be the first Icon in the lower right hand corner of your task bar. The task scheduler will take a Command line argument to open the database and run a macro that you can program to call any Function you need. I use it to run a report everyday at 3 p.m. It works just fine. My command line includes the switch
/x MacroName (I think this is the correct switch. I'll have to confirm that in the a.m. if you are interested)
to run the macro. This in turn calls a Function that checks the day of the week and runs the report if it's between Monday and Friday. Then it closes the instance of Access that it has opened. You don't have to have the database open for this to work which makes it nicer than using the Timer Event.
Post back if you have any questions.

Paul
 
Will the task scheduler close Access after the task is completed? I assume I could set the macro to close Access after the event runs. Ralph Solomon
Comcast Cable Communications
ralph_solomon@cable.comcast.com
 
Yes, you can close the Application directly from the macro. This is what I use in the Run Argument for Task Scheduler. The switch that calls the Macro is /x:MacroNameHere

"C:\Program Files\Microsoft Office\Office\MSACCESS.EXE" "\\SCHOOLHOUSE\PhyPlant\Physical Plant 2002\PysPlant2002.mdb" /x:printReportMacro

This is what I use in the Start In argument.

"C:\Program Files\Microsoft Office\Office\MSACCESS.EXE"

Setting up the time and everything is quite simple to do. Post back if you need more info.

Paul
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top