Honestvip
جمعه 10 مرداد 1393, 09:52 صبح
سلام دوستان
مشکل این کد برای فرم ورود چیه
این پیغام رو میده
RUN TIM ERROR 3471
THE EXPRSSION YOU ENTERED AS A QUERY PARAMETER PRODUCED THIS ERROR 'پشتیبانی'
Private Sub cmdLogin_Click()
If IsNull(Me.strUserName) Or Me.strUserName = "" Then
MsgBox "You must enter a User Name.", vbOKOnly, "Required Data"
Me.strUserName.SetFocus
Exit Sub
End If
'Check to see if data is entered into the password box
If IsNull(Me.strPassword) Or Me.strPassword = "" Then
MsgBox "You must enter a Password.", vbOKOnly, "Required Data"
Me.strPassword.SetFocus
Exit Sub
End If
'Check value of password in tblEmployees to see if this matches value chosen in combo box
If Me.strPassword.Value = DLookup("strPassword", "dbo_UserName", "[strUserName]=" & Me.strUserName.Value) Then
' lngMyEmpID = Me.cboEmployee.Value
'Close logon form and open splash screen
Me.Visible = False
'DoCmd.Close acForm, "frmLogon", acSaveNo
DoCmd.OpenForm "NavigationForm"
Else
MsgBox "Password Invalid. Please Try Again", vbOKOnly, "Invalid Entry!"
Me.strPassword.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 your system administrator.", vbCritical, "Restricted Access!"
Application.Quit
End If
مشکل این کد برای فرم ورود چیه
این پیغام رو میده
RUN TIM ERROR 3471
THE EXPRSSION YOU ENTERED AS A QUERY PARAMETER PRODUCED THIS ERROR 'پشتیبانی'
Private Sub cmdLogin_Click()
If IsNull(Me.strUserName) Or Me.strUserName = "" Then
MsgBox "You must enter a User Name.", vbOKOnly, "Required Data"
Me.strUserName.SetFocus
Exit Sub
End If
'Check to see if data is entered into the password box
If IsNull(Me.strPassword) Or Me.strPassword = "" Then
MsgBox "You must enter a Password.", vbOKOnly, "Required Data"
Me.strPassword.SetFocus
Exit Sub
End If
'Check value of password in tblEmployees to see if this matches value chosen in combo box
If Me.strPassword.Value = DLookup("strPassword", "dbo_UserName", "[strUserName]=" & Me.strUserName.Value) Then
' lngMyEmpID = Me.cboEmployee.Value
'Close logon form and open splash screen
Me.Visible = False
'DoCmd.Close acForm, "frmLogon", acSaveNo
DoCmd.OpenForm "NavigationForm"
Else
MsgBox "Password Invalid. Please Try Again", vbOKOnly, "Invalid Entry!"
Me.strPassword.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 your system administrator.", vbCritical, "Restricted Access!"
Application.Quit
End If