my program has two user accounts - administrator and a guest
when i login as an administrator then i have the full access on the commands while if i login as a guest then only the basic commands will be availabe. here's my code:
Private Sub cmdLogin_Click()
Dim Username As String
Dim Password As String
Username = Me.txtUser.Text
Password = Me.txtPwd.Text
If Username = adoLog.Recordset("User").Value And Password = adoLog.Recordset("Password") And adoLog.Recordset("UType") = "Administrator" Then
ElseIf adoLog.Recordset("UType") = Guest Then
.cmdEdit.Enabled = False
.cmdDelete.Enabled = False
.cmdAccounts.Enabled = False
ElseIf txtUser.Text = "" And txtPwd.Text = "" Then
MsgBox "Please enter your username and password!", vbOKOnly + vbCritical, "Login"
MsgBox "Wrong credentials!", vbOKOnly + vbCritical, "Login"
txtUser.Text = ""
txtPwd.Text = ""
my problem is that when i use the guest account, the messagebox "Wrong credentials" appear and therefor can not login, but if i use the administrator account i can access the system..can anyone help me?