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
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