help how can i know if the user is not an admin
i have combo box in my combo box have a user or admin additem if he choose admin then all i want is to validate if the username and password is for admin user this is my code
Private Sub Form_Load()
Call Opencn
With Combo1
.AddItem ("Administrator")
.AddItem ("User")
End With
End Sub
Private Sub lvButtons_H1_Click()
Set rs = New ADODB.Recordset
rs.Open "SELECT * FROM Login WHERE UserName = '" & Text1.Text & "' AND Password = '" & Text2.Text & "'", cn, adOpenKeyset, adLockPessimistic
If Combo1.Text = "Administrator" Then
If rs.RecordCount > 0 Then
frmBegin.Label4.Caption = rs!Fullname
frmBegin.Show
Unload Me
Exit Sub
Else
MsgBox "Your Username or Password is incorrect", vbCritical
End If
End If
End Sub