By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,894 Members | 2,002 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,894 IT Pros & Developers. It's quick & easy.

Run-time error 3075 syntax error (missing operator) in query expression when serching

P: 1
Hello. In dying need of assistance. All I am trying to do is search a table for a valid user ID for a form login screen and I am getting error :

"Run-time error 3075 syntax error (missing operator) in query expression "

I get it {on line #8} when using this code. Here is my subroutine and this is MS Access
Expand|Select|Wrap|Line Numbers
  1. Private Sub Command84_Click()
  2.     If IsNull(Me.Text85) Then
  3.         MsgBox "Please enter LoginID", vbInformation, "Valid Login ID Required"
  4.         Me.Text85.SetFocus
  5.     Else
  6.         'Process the search for Valid user ID
  8.         If (IsNull(DLookup("User Login ID", "tblUser Account Control", "User Login ID='" & Me.Text85.Value & "'"))) Then
  9.             MsgBox "Incorrect Login ID"
  10.         Else
  11.             DoCmd.Close
  12.             DoCmd.OpenForm "Form_VKEY PWD"
  13.         End If
  14.     End If
  15. End Sub
Sep 7 '14 #1
Share this Question
Share on Google+
2 Replies

P: 104
Try putting the field name in braces like "[User Login ID]", and/or I think you need to remove the quotes that surround Me.Text85.Value since this value is a number and not a string.
Sep 7 '14 #2

Expert Mod 15k+
P: 31,491
Absolutely right to surround the reference to User Login ID with brackets ([]), but I suspect the value probably is actually a string, so no change on the quotes.
Sep 7 '14 #3

Post your reply

Sign in to post your reply or Sign up for a free account.