Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Form close automatically after certain amount of time 1

Status
Not open for further replies.

cmmd2003

Programmer
Mar 23, 2007
28
GB
IS there a way of making a form close automatically after a period of inactivity.
 
How are ya cmmd2003 . . .

Have a look at the forms [blue]On Timer[/blue] and [blue]Timer Interval[/blue] events!

Calvin.gif
See Ya! . . . . . .

Be sure to see thread181-473997
Also faq181-2886
 
Thanks for all your help.
Your a wiseman.
That made sense, but is there a way i can set it so that if the computer has been left in the same state for, lets jus say 30 seconds, then something happens.
 
cmmd2003 . . .

What have you tried? . . .

Calvin.gif
See Ya! . . . . . .

Be sure to see thread181-473997
Also faq181-2886
 
I havent tried anything apart from using the timer interval. But that just runs the DoCmd consistently over an interval
 
cmmd2003 . . .

Roger That!
[blue] . . . but is there a way i can set it so that [purple]if the computer has been left in the same state[/purple] for, lets jus say 30 seconds, then something happens.[/blue]
If we define [blue]the same state[/blue] as [purple]no keyboard activity[/purple] (as far as the user interface is concerned), perform the following:
[ol][li] in form design view, set the forms [blue]Key Preview[/blue] event to [purple]Yes[/purple].[/li]
[li]In the forms [blue]On Key Down[/blue] event, copy/paste the following:
Code:
[blue]   Me.TimerInterval = 30000[/blue]
[purple]This resets the timer on each keypress[/purple]. If no keypress for 30 seconds the [blue]On Timer[/blue] event is executed.[/li]
[li]Enter the code you want to execute in the forms [blue]On Timer[/blue] event. Before doing so (for test purposes), enter the following line:
Code:
[blue]   MsgBox "Time Is Up!"[/blue]
[/li]
[li]Perform your testing . . .[/li]
[li]When satisified enter your code in the [blue]On Timer[/blue] event.[/li]
[li]Done![/li][/ol]
[blue]Your Thoughts? . . .[/blue]

Calvin.gif
See Ya! . . . . . .

Be sure to see thread181-473997
Also faq181-2886
 
Nothing seems to happen. The Timer Interval event is left at 0. Not sure if that makes any differnce
 
cmmd2003 . . .

Woops![surprise] . . . forgot to start the car!

The same line you entered in the forms [blue]On Key Down[/blue] event, enter in the [blue]On Load[/blue] event.

Calvin.gif
See Ya! . . . . . .

Be sure to see thread181-473997
Also faq181-2886
 
Thanks.. your a legend.
Would it work the same with On Mouse Move
 
[blue]No reason why not! . . .[/blue]

Calvin.gif
See Ya! . . . . . .

Be sure to see thread181-473997
Also faq181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top