I have the following:
- table Exit Now Request, comprising a single record with the Yes/No field Exit_Now
- a button on a menu that brings up the form Exit Now Request, which presents Exit_Now for modification
- form ExitingMessage, which just contains the "exiting in 1 minute" text (no "okay" button or anything)
- the following code (this code is in the On Timer event of form Detect Idle Time, which is opened by AutoExec and exists for the user's entire session--it monitors a user's activity, and quits the front end when the user has been inactive for more than the specified time (conIdleMinutes, which is 5, but is not referenced in this code). that all works great, thanks to this forum. this code is in that subroutine, but runs prior to the monitoring stuff.):
Expand|Select|Wrap|Line Numbers
- Dim ExitWaiting
- ExitWaiting = 0
- If Me.Exit_Now Then
- DoCmd.OpenForm ExitingMessage
- While (ExitWaiting / conTimerInterval) / 60 < conExitWait
- ExitWaiting = ExitWaiting + conTimerInterval
- Wend
- Application.Quit acSaveYes
- End If
I know I'm not handling the time correctly, because the ExitingMessage comes up, but then the quit happens immediately.
Can you help me untangle how I should be calculting that 1 minute of grace?