I have a form (frmCron) whose code in the OnTimer event property
is set by the TimerInterval property to run 86400000 milliseconds. I
open this form in the AutoExec sequence when the mdb file opens.
I was hoping the code ran as soon as frmCron opened and then
every 86400000 milliseconds thereafter. But, of course, that is not
the case.
How can I run the code as soon as frmCron is opened and then
every 86400000 milliseconds thereafter?
Arno R - 12 Jan 2006 23:41 GMT
> How can I run the code as soon as frmCron is opened and then
> every 86400000 milliseconds thereafter?
Set TimerInterval to 10 and open/close your db every day at the same time?
Is this a db that runs 24/7 ??
I guess you only need something like a TimerInterval of 10 or so.
Run your code and reset the TimerInterval the first time like ...
Sub Form_Timer()
Me.TimerInterval=86400000
Your code here ...
End sub
Arno R
Bob Quintal - 13 Jan 2006 00:02 GMT
> I have a form (frmCron) whose code in the OnTimer event
> property is set by the TimerInterval property to run 86400000
[quoted text clipped - 5 lines]
> How can I run the code as soon as frmCron is opened and then
> every 86400000 milliseconds thereafter?
In the form_open event,
Call OnTimer

Signature
Bob Quintal
PA is y I've altered my email address.