I'm using Ms-access 2003.I have a table called users it has two fields called Username and password.I have created a form called security interface.where the user enters the username and password.Can you check the following code.it is not working.I want the code to verify if the entered password and username is correct and open a form or else tell the user to re-enter.
Dim STDOCNAME As String
Dim stuser_login As String
Cmb_User.SetFoc us
Setrs = Me.RecordsetClo ne = Me![Cmb_User] & "'"
Me.Bookmark = rs.Bookmark
Verify = Me.Password
STDOCNAME = "WELCOME TO CONTRACTS MANEGEMNT SYSTEM"
DoCmd.OpenForm STDOCNAME, , , stuser_login
If Fld_PASSWORD = Verify Then
If Fld_Username = Verify Then
If UCase(Fld_Usern ame) = "HENDRINA" Then
If UCase(Fld_PASSW ORD) = "JOD" Then
Else
MsgBox "Incorrect password"
End If
End If
End If
End If
Dim STDOCNAME As String
Dim stuser_login As String
Cmb_User.SetFoc us
Setrs = Me.RecordsetClo ne = Me![Cmb_User] & "'"
Me.Bookmark = rs.Bookmark
Verify = Me.Password
STDOCNAME = "WELCOME TO CONTRACTS MANEGEMNT SYSTEM"
DoCmd.OpenForm STDOCNAME, , , stuser_login
If Fld_PASSWORD = Verify Then
If Fld_Username = Verify Then
If UCase(Fld_Usern ame) = "HENDRINA" Then
If UCase(Fld_PASSW ORD) = "JOD" Then
Else
MsgBox "Incorrect password"
End If
End If
End If
End If
Comment