Hi, I have this set of coding when i use it when i am in ms access 97 but not ms access 2007. this is a set of coding for login form of ms access. Whenever i log in with the correct userid and password, it always promt me "wrong password!! enter again"
i think that this is the part "mark in red" where the error came in.
rst.Index = "prima"
.Seek "=", luserid, lpwd
If .NoMatch Then
If b < 10 Then
b = b + 1
Msg = "Wrong password!! Enter again"
Style = vbOKOnly + vbCritical
Title = "Login"
Response = MsgBox(Msg, Style, Title)
tpwd.Text = String(20, " ")
.Bookmark = varbook
!num = b + !num
For your info, prima is the index for userid only.
If it is just for login form then why you are using .update and .edit your code is confusing but you can use simply this code for login
On Error GoTo errHandler
Set rs = db.OpenRecordset("SELECT COUNT(*) As Numrows FROM users WHERE LCASE(username) = '" & LCase(txtusername.Text) & "' AND LCASE(pw) = '" & LCase(txtpassword.Text) & "'")
If CInt(rs.Fields!Numrows) > 0 Then
MsgBox "YOU HAVE SUCCESSFULLY SIGNED IN", vbOKOnly, "EXCELLENT ACADEMY"
MsgBox "LOGIN DENIED PLEASE TRY AGAIN!!"
txtusername.Text = ""
txtpassword.Text = ""