G
Guest
I cannot figure out what to put in my String Expression. It fails at
"strUserPassword"...
This is my code:
Private Sub cmdLogin_Click()
'Check to see if data is entered into the RACF combo box cboUser
If IsNull(Me.cboUser) Or Me.cboUser = "" Then
MsgBox "You must enter a RACF.", vbOKOnly, "Required Data"
Me.cboUser.SetFocus
Exit Sub
End If
'Check to see if data is entered into the password box txtPassword
If IsNull(Me.txtPassword) Or Me.txtPassword = "" Then
MsgBox "You must enter a Password.", vbOKOnly, "Required Data"
Me.txtPassword.SetFocus
Exit Sub
End If
'Check value of password in t_Users to see if this
'matches value chosen in txtPassword combo box
If Me.txtPassword.Value = DLookup("strUserPassword", "t_Users", "[RACFID]="
& Me.cboUser.Value) Then
lngMyRACFID = Me.cboUser.Value
'Close login form and open splash screen
DoCmd.Close acForm, "f_Login", acSaveNo
DoCmd.OpenForm "f_Splash"
Else
MsgBox "Password Invalid. Please Try Again", vbOKOnly, "Invalid Entry!"
Me.txtPassword.SetFocus
End If
'If User Enters incorrect password 3 times database will shutdown
intLogonAttempts = intLogonAttempts + 1
If intLogonAttempts > 3 Then
MsgBox "You do not have access to this database.Please contact admin.",
vbCritical, "Restricted Access!"
Application.Quit
End If
End Sub
"strUserPassword"...
This is my code:
Private Sub cmdLogin_Click()
'Check to see if data is entered into the RACF combo box cboUser
If IsNull(Me.cboUser) Or Me.cboUser = "" Then
MsgBox "You must enter a RACF.", vbOKOnly, "Required Data"
Me.cboUser.SetFocus
Exit Sub
End If
'Check to see if data is entered into the password box txtPassword
If IsNull(Me.txtPassword) Or Me.txtPassword = "" Then
MsgBox "You must enter a Password.", vbOKOnly, "Required Data"
Me.txtPassword.SetFocus
Exit Sub
End If
'Check value of password in t_Users to see if this
'matches value chosen in txtPassword combo box
If Me.txtPassword.Value = DLookup("strUserPassword", "t_Users", "[RACFID]="
& Me.cboUser.Value) Then
lngMyRACFID = Me.cboUser.Value
'Close login form and open splash screen
DoCmd.Close acForm, "f_Login", acSaveNo
DoCmd.OpenForm "f_Splash"
Else
MsgBox "Password Invalid. Please Try Again", vbOKOnly, "Invalid Entry!"
Me.txtPassword.SetFocus
End If
'If User Enters incorrect password 3 times database will shutdown
intLogonAttempts = intLogonAttempts + 1
If intLogonAttempts > 3 Then
MsgBox "You do not have access to this database.Please contact admin.",
vbCritical, "Restricted Access!"
Application.Quit
End If
End Sub