Sub FlagUser(ID As String)

'A Subroutine to deactive a user

‘NOTE: THE USER TABLE HAS TO BE RENAMED AS tblUSER

 

Dim rec As ADODB.Recordset

 

Set rec = New ADODB.Recordset

 

rec.ActiveConnection = CurrentProject.Connection

rec.CursorType = adOpenStatic

rec.LockType = adLockPessimistic

 

rec.Open "tblUSER"

rec.Find ("UserName =  ‘" & ID & “’”)

rec("Type") = "deactivated"

rec.Update

rec.Close

Set rec = Nothing

 

End Sub