moose
c'mon Chelsea
- Local time
- Today, 12:29
- Joined
- May 18, 2001
- Messages
- 139
Password Form
I have the following code
but there seems to be something wrong
The debugger points to the "Password = Me.txtPassword.Value" section, but i don't know why
Please help
I have the following code
Code:
Private Sub cmdOK_Click()
'On Error GoTo Err_cmdOK_Click
If IsNull(Me.TxtName) Or Me.TxtName = "" Then
MsgBox "You must enter a User Name.", vbCritical, "User Name Required"
Me.TxtName.SetFocus
Exit Sub
End If
If IsNull(Me.txtPassword) Or Me.txtPassword = "" Then
MsgBox "You must enter a valid password.", vbCritical, "Enter a valid password."
Me.txtPassword.SetFocus
Exit Sub
End If
If Me.txtPassword.Value = DLookup("strpassword", "TblUsers", "[password] =" & Me.txtPassword.Value) Then
Password = Me.txtPassword.Value
DoCmd.Close acForm, "FrmPassword", acSaveNo
DoCmd.OpenForm "frmadminarea"
Else
MsgBox "Password Invalid, Please try again.", vbCritical, "Invalid Password Entered"
Me.txtPassword.SetFocus
End If
intlogonattempts = intlogonattempts + 1
If logonattempts > 3 Then
MsgBox "You have entered the wrong password 3 times, Please contact your administrator.", vbCritical, "Access denied!!"
Application.Quit
End If
Exit sub
but there seems to be something wrong
The debugger points to the "Password = Me.txtPassword.Value" section, but i don't know why
Please help
Last edited by a moderator: