Timer

B

Brendanpeek

Can anyone provide me with the code for a timer that at 00:01am will run a
module called Email Test.

Plus how can i get a report to be sent in the email which this module sends.
 
D

dch3

In order to use the onTimer event, Access must be open and a hidden form
open. In the hidden form set the Timer Interval to run the OnTimer event ever
so often - say every 15 minutes.

TimerInterval = 900000
(1000 = 1 second)

Then in the OnTimer event, add code that checks the time. You'll probably
have to set up a variable at the module level to capture the value and then
check it against the current time to determine if the code should run since
you won't be able to hit 00:01 AM on the nose.

However, my recommendation is to create a VBS script and have the script run
on your Windows server to open Access and execute the code. The VBS script
would be set up as a Windows Task to run at 00:01 AM. The code would be
something like...

set obj=createobject("access.application")

'Probably (I'm assuming that this is correct, I've never executed code from
VBS, but it is possible)
obj.RunMacro

set obj = nothing
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top