I'm curious whether you've tested the code.
I've checked that while MsgBox is active no Timer event will be triggered, no code will run asynchronously.
No such a problem with special form. In this case there are two opportunities:
1) to handle timer event from this warning form
2) to handle timer event from the IdleUser detecting form (somewhat more sophisticated)
Good luck.
FishVal,
I don't follow you. My suggested code runs only if the response to the message to the MsgBox is "No", so the MsgBox is no longer active at that point.
FishVal,
I don't follow you. My suggested code runs only if the response to the message to the MsgBox is "No", so the MsgBox is no longer active at that point.
Sorry. Maybe I've not got a point. Lets straight it.
The logic is:
1. to detect idle user situation
2. to warn the user about db closing
2.1. User confirms quit -> quit
2.2. User denies quit -> restart idle timer
2.3. User doesn't respond within a definite time period -> quit
Am I right?
If so, MsgBox will be helpless in p. 2.3.
Sorry. Maybe I've not got a point. Lets straight it.
The logic is:
1. to detect idle user situation
2. to warn the user about db closing
2.1. User confirms quit -> quit
2.2. User denies quit -> restart idle timer
2.3. User doesn't respond within a definite time period -> quit
Am I right?
If so, MsgBox will be helpless in p. 2.3.
FishVal,
OK, In writing my code, I understood NewToAccess to mean he wanted the ability to click the "no" button on the message box before actually following through with the shutdown of the application. If that is the case my code works, If that is not the case, and he wants the shutdown to occur without having to click the "no" button, then your scenario would be correct.
FishVal,
OK, In writing my code, I understood NewToAccess to mean he wanted the ability to click the "no" button on the message box before actually following through with the shutdown of the application. If that is the case my code works, If that is not the case, and he wants the shutdown to occur without having to click the "no" button, then your scenario would be correct.
An old shit. Who will guard the guards.
Who will do it for himself, if he does it for everybody who doesn't do it himself.
:)
PS. Custom form provides additional functionality, for example displaying final countdown.
NewtoAccess,
the Form module simply means the code behind a form (e.g. your idleTimeDected form) as opposed to a standard module or macro. You need to decide how you want the code to work before proceeding.
pretty much as descibed on the MS support site. After a set amount of idle time, I would like the user to automatically logged-off
pretty much as descibed on the MS support site. After a set amount of idle time, I would like the user to automatically logged-off
I followed the directions on the MS support page. I put this code in the ON FOCUS EVENT
Private Sub Form_GotFocus()
Sub IdleTimeDetecte d(ExpiredMinute s)
Dim Msg As String
Msg = "No user activity detected in the last "
Msg = Msg & ExpiredMinutes & " minute(s)!"
MsgBox Msg, 48
End Sub
Not sure what to expect......How does the detectidletime form get focus?? Is there a macro I must write so that the form is constantly running in the background?
I followed the directions on the MS support page. I put this code in the ON FOCUS EVENT
Private Sub Form_GotFocus()
Sub IdleTimeDetecte d(ExpiredMinute s)
Dim Msg As String
Msg = "No user activity detected in the last "
Msg = Msg & ExpiredMinutes & " minute(s)!"
MsgBox Msg, 48
End Sub
Not sure what to expect......How does the detectidletime form get focus?? Is there a macro I must write so that the form is constantly running in the background?
A picture is worth a thousand words. See the link below for a free download demo mdb with source code, entitled Detect & Logoff Idle Users.
I referred to the link of the ms support website and it works fine.
But is it possible to detect inactivity when one form is on top of another?
What I mean is I have a main form - formList and when I click on a command button within the formList, another form - formDetails will open up.
In other words, the formList must be open before I can open the formDetails.
I want to auto log off at formList and formDetails.
I've put the code in both forms. But while I'll keying in details in the formDetails - the formList will be inactive.
Basically what I'm looking for is - if the formDetails is opened, it will check inactivity on that form & log off from the application.
But if only the formList is opened, it will check inactivity on the formList.
Comment