sillyman
10-22-2004, 09:24 AM
I need help with the below code, basically I want it to show diffrent forms for diffrent priv values but it only works for priv value = to 1 not 0 it dosent do anything then!
rs.Open "Select * From Users Where [Username]= '" & txtUsername.Text & "' And [Password]= '" & txtPassword.Text & "'", cnn, adOpenForwardOnly, adLockReadOnly
With rs
If .Fields("Privalliages").Value = 1 Then
If Not (rs.EOF And rs.BOF) Then
MsgBox "Admin Mode"
Else
MsgBox "incorrect"
If .Fields("Privalliages").Value = 0 Then
If Not (rs.EOF And rs.BOF) Then
MsgBox "normal mode"
Else
MsgBox "incorrect"
End If
rs.Open "Select * From Users Where [Username]= '" & txtUsername.Text & "' And [Password]= '" & txtPassword.Text & "'", cnn, adOpenForwardOnly, adLockReadOnly
With rs
If .Fields("Privalliages").Value = 1 Then
If Not (rs.EOF And rs.BOF) Then
MsgBox "Admin Mode"
Else
MsgBox "incorrect"
If .Fields("Privalliages").Value = 0 Then
If Not (rs.EOF And rs.BOF) Then
MsgBox "normal mode"
Else
MsgBox "incorrect"
End If