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

ok i'm trying to set-up a means to

Status
Not open for further replies.

blurworld

Programmer
Sep 19, 2001
46
GB
ok i'm trying to set-up a means to log users off in the unusual event of a user crashing and leaving the LDB (locking) file in a state where it believes the user is still logged on and therefore they are unable to log back in. The code stands as follows and may be extended but at the moment i'm gettin

Set LO = Db.OpenRecordset("LogOff", dbOpenSnapshot)
...highlighted and "Run-time error "13" _Type mismatch"

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("LogOff", dbOpenSnapshot)
LO.MoveFirst
LogOff = LO!LogOff
LO.Close
Db.Close

If LogOff = True Then
If Not MsgSent Then
MsgBox "The Application will be shutting down in one (1) minute for maintenance, please log off immediately."
Me.TimerInterval = 60000 'change to one minute
MsgSent = True
Else
Application.Quit 'Log them off now.
End If
End If
End Sub

any ideas? :)

Martin
 
This has been recently - as in the last few months) discussed herein and code posted. Look for it.

MichaelRed
m.red@att.net

There is never time to do it right but there is always time to do it over
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top