By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,247 Members | 1,287 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,247 IT Pros & Developers. It's quick & easy.

Password verification

P: 5
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.

Expand|Select|Wrap|Line Numbers
  1. Dim STDOCNAME As String
  2. Dim stuser_login As String
  3.  
  4.     Cmb_User.SetFocus
  5.     Setrs = Me.RecordsetClone = Me![Cmb_User] & "'"
  6.     Me.Bookmark = rs.Bookmark
  7.     Verify = Me.Password
  8.     STDOCNAME = "WELCOME TO CONTRACTS MANEGEMNT SYSTEM"
  9.     DoCmd.OpenForm STDOCNAME, , , stuser_login
  10.  
  11.     If Fld_PASSWORD = Verify Then
  12.         If Fld_Username = Verify Then
  13.  
  14.             If UCase(Fld_Username) = "HENDRINA" Then
  15.                 If UCase(Fld_PASSWORD) = "JOD" Then
  16.  
  17.  
  18.                 Else
  19.                     MsgBox "Incorrect password"
  20.                 End If
  21.             End If
  22.         End If
  23.     End If
  24.  
Oct 19 '07 #1
Share this Question
Share on Google+
1 Reply


MMcCarthy
Expert Mod 10K+
P: 14,534
OK there are a number of problems which I will try to address
The biggest one is here

Expand|Select|Wrap|Line Numbers
  1.      Setrs = Me.RecordsetClone = Me![Cmb_User] & "'"
Setrs doesn't mean anything. However ...

Expand|Select|Wrap|Line Numbers
  1. Dim rs as Recordset
  2.  
  3.     Set rs = Me.RecordsetClone
does.

You cannot however then try to set it to Me![Cmb_User] & "'"

Why were you trying to do this?

Also RecordsetClone will take into memory a copy of all records currently bound to the form. I don't think that's what you are trying to do.

Can you explain in plain english what you were trying to do here?
Oct 19 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.