im trying to check if the status activity of a user is false or not before he enteres the system however i did some coding and when i try to enter a name it dosnt do nothing at all
if a user that is active in the system still same thing.
this is the code:
if a user that is active in the system still same thing.
this is the code:
Code:
If Txt(0).text = "" Then
MsgBox "name is empty", vbExclamation
Txt(0).SetFocus
Exit Sub
End If
If Txt(1).text = "" Then
MsgBox "יpassword is empty", vbExclamation
Txt(1).SetFocus
Exit Sub
End If
Set rs = CN.Execute("select EmpName, EmpActive from Employees where EmpName= '" & RplS(Txt(0).text) & "'")
If Not rs.EOF Then
Select Case rs![EmpActive]
Case "Not Active"
MsgBox "this user cannot login beacuse he is registered as not active", vbExclamation, ""
Txt(9).text = ""
Case Else
Set rs = CN.Execute("SELECT UserName, UserPass FROM Users WHERE UserName= '" & RplS(Txt(0).text) & "'")
If rs.EOF Then
MsgBox "name doesnt exists in the database, ""
Txt(0).text = ""
Txt(1).text = ""
Txt(0).SetFocus
ElseIf Txt(1).text <> rs!UserPass Then
MsgBox "wrong password", vbInformation, ""
Txt(1).text = ""
Txt(1).SetFocus
Else
UsLogin = Txt(0).text
Unload Me
End If
End Select
frmload.Show 1
End If