guys i cant get through my login window,its inorect,but i dont know what's wrong,here is the code for my login form can you help me please


Private Sub Command1_Click()

End Sub

Private Sub cmdok_Click()

Dim mPass, mEncrypt As String
mPass = txtpassword.Text + "Password Protected"
For i = 1 To Len(mPass)
mEncrypt = mEncrypt + Chr(Asc(Mid(mPass, i, 1)) + 100)
Next i


RSconn "select * from tbluseraccess"
With RS
.Filter = "Username= '" & txtusername.Text & " ' " & "and password = '" & Me.txtpassword.Text & "'"
If RS.RecordCount <> 0 Then

RSconn "select * from tbllevel where username='" & Me.txtusername & "'"
If RS.Fields("access_level") = "Administrator" Then
frmadminmain.Show
ElseIf RS.Fields("access_level") = "Faculty" Then
frmmain.Show
Unload Me
End If

Else
MsgBox "no"
End If

End With



If RS.RecordCount = 0 Then
RSconn1 "select * from tbllock"
RS1.Fields("Lock") = Val(RS1.Fields("Lock")) + 1
RS1.Update

MsgBox "Access Denied!" + vbCrLf + vbCrLf + "Invalid Username and/or Password!" + vbCrLf + vbCrLf & 3 - Val(RS1.Fields("Lock")) & "Attempt/s remaining!", vbCritical, " Login Error"

If Val(RS1.Fields("Lock")) = 3 Then
MsgBox "Unauthorized User! System Blocked!", vbCritical + vbOKOnly, " Warning"
frmblockedac.Show
End If

Else
RSconn1 "select * from tbllock"
If RS1.Fields("Lock") = 0 Then



Unload Me

Else
RS1.Fields("Lock") = 0
RS1.Update



Unload Me
End If
End If







End Sub

Private Sub Form_Load()
Call DCN

RSconn "select * from tbluseraccess"
If RS.RecordCount = 0 Then
frmregistration.Show
Unload Me
End If

RSconn1 "Select * from tbllock"
If RS1.Fields("Lock") = 3 Then
Unload Me
frmblocked.Show
End If

End Sub