Full Version: Timer settings
UtterAccess Discussion Forums > Microsoft® Access > Access Tables + Relationships
lima
How to triger a Timer if no any actions on current form (eg. no keystroke,no mouse movement...)
Johan_Koers
Can you be more specific.
For example there is a standard function which allows you to activate a timer when the form opens.
lima
Just for security issues, let's say, I set a Timer period as 5 minuts, if user didn't do anything in 5 mminuts, the Timer will be trigerd, the warning message will be displayed, but, here is a but, if user did do something, like moved mouse, enterd keyboard, the Timer should be reset every time user does something.

Something Like Windows Screen Saver\Power\Advanced tab\Options, "Prompt for password when computer goes off standby"
lima
Any one know how to code in VB event procedure for the scenario discribed below:

Set a Timer period as 5 minuts, if user didn't do anything in 5 mminuts, the Timer will be trigerd, the warning message will be displayed, but, here is a but, if user did do anything (like move mouse, enter keyboard), the Timer should be reset every time user does something
jsitraining
Hi
try something like:
for each relevant event;
(Click, dblClick, MouseMove, KeyPress should catch most that you need) insert the code
Me.TimerInterval = X
Where X represents the number of miliseconds you want the delay between no action and a password prompt
In the OnTimer event
place the code to ask for and verify the password
HTH
Jim
lima
Thanks for the reply, are those event form's event or all control's on that form. If I have twenty something controls on the form, do I need to code for each one of them?
jsitraining
No. You should only have to do it on the form. As soon as it picks up the mouse moving, being clicked or a key being hit it should reset the timer interval (something like 300,000) will give you 5 minutes)
HTH
Jim
lima
Thank you Jim.

I tried, but if I do something on any one of those controls instead of form itself during timer interval, Timer still being trigerd, I guess I have to code for every control and form.

Malily
jsitraining
Hmmm
I tested it and it seems to work. Can you zip and post the Db?
Jim
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.