Experts Exchange Solution brought to you by
"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.
Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.
Option Compare Database
Const timeToRun As Date = #9:00:00 PM#
Const DelayFromLastActivity As Long = 5
'minutes of delay
Open in new window
Private Sub Form_Load()
If DateDiff("s", Time(), timeToRun) < DelayFromLastActivity Then
TheInterval = DelayFromLastActivity * 60 * 1000
TheInterval = DateDiff("s", Time(), timeToRun) * 1000
Me.TimerInterval = TheInterval
DontSkipMessage = True
Private Sub Form_Unload(Cancel As Integer)
Dim response As Integer
If DontSkipMessage = True Then
response = MsgBox("Did you really intend to quit The Program? Yes to Quit, no to remain in The Program", vbYesNo + vbCritical, "Quit?")
If response = vbNo Then
Cancel = True
If Application.CurrentProject.AllForms("frmStartupScreen").IsLoaded = False Then
Global DontSkipMessage As Boolean
Public TheInterval As Long
From novice to tech pro — start learning today.
Members can enroll in this course at no extra cost.