ANyways try this sunshine!

VB Code:
  1. Private Sub cmdLogin_Click()
  2. Uname = txtUsername.Text
  3. Pword = txtPassword.Text
  4. Set db = OpenDatabase("C:\Windows\Desktop\users.mdb")
  5. MsgBox "got here"
  6. strSQL = "Select * FROM usertable Where usertable.[Username] =""" & Uname & """;"
  7. Set rs = db.OpenRecordset(strSQL, dbOpenDynaset)
  8. If rs.RecordCount = 0 Then MsgBox "No user by the name " & Uname & ". Please check the name you entered.", vbInformation: Exit Sub
  9. TestPass = rs!Password
  10. If TestPass = Pword Then MsgBox "Correct password!"
  11. rs.Close
  12. db.Close
  13. End Sub