Here's what I want to do: At a specific time, I want to give the user a five warning to exit the database. After 5 minutes I want to kick the user off the database.
Here's what I tried: (1) Created a hidden form. On the hidden form using a Timer Interval of 300000, I placed an Event Procedure on the On Timer.
If (Time() >= #4:54:00 PM# And Time() <= #4:59:00 PM#) Then
Msgbox "Please exit this program within 5 minutes. System Maintenance is about to begin.", vbOKOnly
Else
If (Time() >= #5:00:00 PM# And Time() <= #1:00:00 AM#) Then
DoCmd.Quit
Else
End If
End If
The msgbox appears but the program doesn't exit.
Thinking the second part of the If/Then statement wouldn't run without input from the user, I decided not to use the msgbox ... just quit ... the code still doesn't exit.
Any help would be appreciated.
Here's what I tried: (1) Created a hidden form. On the hidden form using a Timer Interval of 300000, I placed an Event Procedure on the On Timer.
If (Time() >= #4:54:00 PM# And Time() <= #4:59:00 PM#) Then
Msgbox "Please exit this program within 5 minutes. System Maintenance is about to begin.", vbOKOnly
Else
If (Time() >= #5:00:00 PM# And Time() <= #1:00:00 AM#) Then
DoCmd.Quit
Else
End If
End If
The msgbox appears but the program doesn't exit.
Thinking the second part of the If/Then statement wouldn't run without input from the user, I decided not to use the msgbox ... just quit ... the code still doesn't exit.
Any help would be appreciated.