D
Denver
Private Sub cmdLogIn_Click()
'Check to see if data is entered into the UserName combo box
If IsNull(Me.Combo33) Or Me.Combo33 = "" Then
MsgBox "Select a User Name first.", vbOKOnly, "Required Data"
Me.Combo33.SetFocus
Exit Sub
End If
'Check to see if data is entered into the password box
If IsNull(Me.Text10) Or Me.Text10 = "" Then
MsgBox "You must enter a Password.", vbOKOnly, "Required Data"
Me.Text10.SetFocus
Exit Sub
End If
'Check value of password in tblUser List & Permission to see if this
'matches value chosen in combo box
Permission)", _
"[User Name]=" & Me.Combo33.Value) Then <<< HERE IS
THE ERROR
strUserName = Me.Combo33.Value
'Close logon form and open splash screen
DoCmd.Close acForm, "frmLogIn", acSaveNo
DoCmd.OpenForm "frmSplash_Screen"
Else
MsgBox "Password Invalid. Please Try Again", vbOKOnly, _
"Invalid Entry!"
Me.Text10.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
I have a Form for user log in, I have a combobox bound in tbl [User List &
Permission] the above VBA code works will, RUN TIME ERROR 3075 occurs when I
clik my cmdLogIn it says Run Time Error '3075': Syntax error (missing
operator) in query expression '[User Name]=Ricky Davao'.
what do I miss in my codes?
thanks for any help, I appreciate
'Check to see if data is entered into the UserName combo box
If IsNull(Me.Combo33) Or Me.Combo33 = "" Then
MsgBox "Select a User Name first.", vbOKOnly, "Required Data"
Me.Combo33.SetFocus
Exit Sub
End If
'Check to see if data is entered into the password box
If IsNull(Me.Text10) Or Me.Text10 = "" Then
MsgBox "You must enter a Password.", vbOKOnly, "Required Data"
Me.Text10.SetFocus
Exit Sub
End If
'Check value of password in tblUser List & Permission to see if this
'matches value chosen in combo box
Permission)", _
"[User Name]=" & Me.Combo33.Value) Then <<< HERE IS
THE ERROR
strUserName = Me.Combo33.Value
'Close logon form and open splash screen
DoCmd.Close acForm, "frmLogIn", acSaveNo
DoCmd.OpenForm "frmSplash_Screen"
Else
MsgBox "Password Invalid. Please Try Again", vbOKOnly, _
"Invalid Entry!"
Me.Text10.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
I have a Form for user log in, I have a combobox bound in tbl [User List &
Permission] the above VBA code works will, RUN TIME ERROR 3075 occurs when I
clik my cmdLogIn it says Run Time Error '3075': Syntax error (missing
operator) in query expression '[User Name]=Ricky Davao'.
what do I miss in my codes?
thanks for any help, I appreciate