J
Jimbo213
Hi -
I am trying to shut down any user who left for the day with the application
still open on their desktop. I want this to run at 5pm every day.
I set a variable "duration" to be the time [in seconds] between when the
user signs in [on switchboard form load] and 5pm or 1700 hours. I then use
the form_timer function to shut down when that duration is reached.
Please help by correcting the DateDiff code below.
I have no idea how to do it and I've checked this discussion group's posts
for about 1 hour already. Thanks.
Private Sub Form_Timer()
Application.Quit acQuitSaveAll
End Sub
Private Sub Form_Load()
' Set the timer interval to be the interval from NOW(log-on) to 5pm
Dim duration As Integer
duration = DateDiff("s", [NOW()], [1700 hours today])
Me.TimerInterval = 1000 * duration
End Sub
I am trying to shut down any user who left for the day with the application
still open on their desktop. I want this to run at 5pm every day.
I set a variable "duration" to be the time [in seconds] between when the
user signs in [on switchboard form load] and 5pm or 1700 hours. I then use
the form_timer function to shut down when that duration is reached.
Please help by correcting the DateDiff code below.
I have no idea how to do it and I've checked this discussion group's posts
for about 1 hour already. Thanks.
Private Sub Form_Timer()
Application.Quit acQuitSaveAll
End Sub
Private Sub Form_Load()
' Set the timer interval to be the interval from NOW(log-on) to 5pm
Dim duration As Integer
duration = DateDiff("s", [NOW()], [1700 hours today])
Me.TimerInterval = 1000 * duration
End Sub