Username & password problem

  • Thread starter Thread starter kristie ann
  • Start date Start date
K

kristie ann

Hey,

I am creating a login system where a user can register only if the
username entered matches a list of usernames in the database. They are
then required to enter a password and retype a password to register.
The main problem Im having is making sure that the username entered
matches that in the database. Also I need to make sure that the
password field in the database is empty, if not then they are an
existing user.... Please if anyone has some code that would help me
with my problem that would be great...Thanks
 
hey, maybe this will help. This is some code that i used for my login page.
Where accessPage is the login form with usernameEntered and passwordEntered
being the values the user typed and mainpage1 is the form that is loaded if
the login details are correct.

Private Sub OK_Click()
On Error GoTo Err_OK_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "mainpage1"

If DCount("[userID]", "users", "[userID] = '" &
Forms!accesspage!usernameEntered & _
"' AND [password]= '" & Forms!accesspage!passwordEntered & "'") > 0 _
Then
DoCmd.OpenForm stDocName, , , stLinkCriteria
DoCmd.Close acForm, "accesspage", acSaveYes
Else

End If

Exit_OK_Click:
Exit Sub

Err_OK_Click:
MsgBox Err.Description
Resume Exit_OK_Click

End Sub
 
Back
Top