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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Inactive database

Status
Not open for further replies.

ryan1

Programmer
May 15, 2002
106
0
0
US
I'm trying to figure out how to monitor the database if a user has not clicked on anything or had any keystrokes in 60 minutes close database. Any help would be great....
 
Well, you can use the TIMER event of a form to check on something within a particular time - the event interval is marked in MILLISECONDS, so to check for something, say, every 10 seconds, you do this:


1) set the TimerInterval to 50000
2) use the ON TIMER event to do something

The timer event fires every time the interval cycles.

Now, the thing is, WHERE are you gonna put this guy, and what are you gonna check for? Keystrokes on a form? Which form? ANY form? Maybe a main menu which you leave OPEN (but hidden when not in use) ?? Trouble is, you might leave the menu form, open a second form, and spend an hour working that form. But the menu, after 60 minutes without focus or a keystroke, thinks you're idle.. That's not what you want.

Somehow, you need to ascertain WHAT object and/or under what circumstances you want to START the timer with, and how to reset it.

Jim



Me? Ambivalent? Well, yes and no....
Another free Access forum:
More Access stuff at
 
I don't think ryan, (or anybody, for that matter) wants to try to capture all OnChange, OnKeyPress, OnMouseMove, etc. events in all forms in the database.

You really have to hook it much lower, perhaps using windows API functions, using the same technique screen savers use (which is more-or-less that the link I posted was about).
 
Right now i have a function that i call on the timer event. But the problem i'm haveing is that the module i'm using is set to open up second form which is a warning form that gives the user 10 seconds to click on a button that keeps the database open if he/she fails to do so the database will shutdown,(problem) the module runs even if the user has entered data into the database in the last 60 minutes. I need some way of seeing if there has been any key strokes in the last 60 minutes.


This is what i'm using

Public glbIdle As Integer
Public glbCountDown As Integer


Public Function OnClock()

glbIdle = glbCountDown + 1

If glbIdle = 1800 Then

DoCmd.OpenForm "frmInactive"
glbIdle = 0
End If


End Function
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top