R
Rpettis31
The form load code which is similar to this works. Idea is that I am able to
log people out of a database when I need to do maintenance or they forgot to
log out from the previous day. The timer code does not seem to be working
Private Sub Form_Timer()
Dim db As DAO.Database
Dim snp As DAO.Recordset
Dim msg As String, intLogoff As Integer
Set db = CurrentDb
Set snp = db.OpenRecordset("tblSettings", dbOpenSnapshot)
intLogoff = snp![LogOff]
snp.Close
db.Close
If intLogoff = True Then
If Me.Tag = "MsgSent" Then
Application.Quit (acQuitSaveAll)
Else
Me.Tag = "MsgSent"
DoCmd.OpenForm "frmExitNow"
End If
End If
End Sub
log people out of a database when I need to do maintenance or they forgot to
log out from the previous day. The timer code does not seem to be working
Private Sub Form_Timer()
Dim db As DAO.Database
Dim snp As DAO.Recordset
Dim msg As String, intLogoff As Integer
Set db = CurrentDb
Set snp = db.OpenRecordset("tblSettings", dbOpenSnapshot)
intLogoff = snp![LogOff]
snp.Close
db.Close
If intLogoff = True Then
If Me.Tag = "MsgSent" Then
Application.Quit (acQuitSaveAll)
Else
Me.Tag = "MsgSent"
DoCmd.OpenForm "frmExitNow"
End If
End If
End Sub