joe_GDB
asked on
Automaticaly run a report in MS Access
I would like to run a report on the 16th and the 1st of each month, and have it run automatically in access.
Right now i have the following that runs a report every night at midnight, it updates a temp table then runs a report:
Private Sub Form_Timer()
If Time() = CDate("12:00am") Then
Call UpdateTempTables
End If
End Sub
I'm wondering is there a way along this same line to run a report on the 16th and 1st of every month?
Right now i have the following that runs a report every night at midnight, it updates a temp table then runs a report:
Private Sub Form_Timer()
If Time() = CDate("12:00am") Then
Call UpdateTempTables
End If
End Sub
I'm wondering is there a way along this same line to run a report on the 16th and 1st of every month?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thanks for the quick response. I like the Task Scheduler idea but how would i set that up to open the specific database and then "Call UpdateTempTables"
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
The TimerInterval and logging success become important because on the 1st and 16th, the form is going to attempt that sub once every 'TimerInterval' milliseconds for the full 24 hrs. You could take the TimerInterval to 300000 - five minutes - or longer. What becomes critical is how crucial it is for the other report to run at EXACTLY midnight, because if you open the form at 4:25, say, and set the interval for an hour, things will happen at 12:25.
It all depends on how you want to tackle it. :)
It all depends on how you want to tackle it. :)
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
Rather then doing this within Access, your better off to call Access with a command line switch (either /x, which calls a macro or /cmd, which passes command line arguments) and use the Windows task scheduler to do the scheduling.
JimD.