I have created this little database and hosted it on a network drive. Since its a multi-user db, many users open it and conviniently forget to close it. Needless to add, this slows the system and no admin stuff can be done, if needed.
Can I make the system automatically figure out it hasn't been used for 3 mins and close the application, silently.....(Yes, thats the way I want it. No messages, nothing - close the DB entirely, infact, exit Access if possible)
-------
I tried the "brutal" way suggested on Thread702-627282 which suggested:
1. Create a table (table1) with one yes/no field set to true. (so I created a table1 and added record with "yes"
2. Create an unbound form (form1). You can open this form as hidden in your AutoExec macro. (done)
3. On Timer event place this code:
Private Sub Form_Timer()
Static MsgSent As Integer
Dim LogOff As Integer
Dim db As Database
Dim LO As Recordset
Set db = CurrentDb()
Set LO = db.OpenRecordset("table1", DB_OPEN_SNAPSHOT)
LO.MoveFirst
LogOff = LO!LogOff
LO.Close
db.Close
If LogOff = True Then
If Not MsgSent Then
MsgBox "The application will terminate in One Minute for maintenance. Please logg off immediately"
Me.TimerInterval = 600000
MsgSent = True
Application.Quit
End If
End If
-----
Did all that too - but it doesn't work ! I get an error message saying
"The Expression you entered on On Timer Even Property .....error: User-defined type not defined."
Can someone PLEASE help ?
----
Then I tried the second, elegant option on Thread702-627282 and got:
"The expression On Timer you entered...produced error:Sub or function not defined"
-----
Where am I going wrong ??? Someone, ANYONE, please help.....
Does the code need some debugging ?
Note: I am no programmer
Can I make the system automatically figure out it hasn't been used for 3 mins and close the application, silently.....(Yes, thats the way I want it. No messages, nothing - close the DB entirely, infact, exit Access if possible)
-------
I tried the "brutal" way suggested on Thread702-627282 which suggested:
1. Create a table (table1) with one yes/no field set to true. (so I created a table1 and added record with "yes"
2. Create an unbound form (form1). You can open this form as hidden in your AutoExec macro. (done)
3. On Timer event place this code:
Private Sub Form_Timer()
Static MsgSent As Integer
Dim LogOff As Integer
Dim db As Database
Dim LO As Recordset
Set db = CurrentDb()
Set LO = db.OpenRecordset("table1", DB_OPEN_SNAPSHOT)
LO.MoveFirst
LogOff = LO!LogOff
LO.Close
db.Close
If LogOff = True Then
If Not MsgSent Then
MsgBox "The application will terminate in One Minute for maintenance. Please logg off immediately"
Me.TimerInterval = 600000
MsgSent = True
Application.Quit
End If
End If
-----
Did all that too - but it doesn't work ! I get an error message saying
"The Expression you entered on On Timer Even Property .....error: User-defined type not defined."
Can someone PLEASE help ?
----
Then I tried the second, elegant option on Thread702-627282 and got:
"The expression On Timer you entered...produced error:Sub or function not defined"
-----
Where am I going wrong ??? Someone, ANYONE, please help.....
Does the code need some debugging ?
Note: I am no programmer