473,396 Members | 2,099 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Missing operator in query, DLookUp()

2
Hello.
I have following function in my query
Expand|Select|Wrap|Line Numbers
  1. DLookUp("name","Q[-]shortages","Q[-]shortages.ItemNumber='" & [PartNumber] & "'") AS Facility
I'm getting an error: Syntax error (missing operator) in query expression: 'Q[-]shortages.ItemNumber=1010'"

Q-shortages is another query, it's not table.

I really don't know what may be wrong.
Thank you for any help
May 30 '16 #1

✓ answered by PhilOfWalton

Try
Expand|Select|Wrap|Line Numbers
  1. DLookup ("Name", "QShortages", "ItemNumber = " & Chr$(34) & PartNumber & Chr$(34))
  2.  
Chr$(34) is always much clearer than a string of single & double quotes

Phil

5 1667
PhilOfWalton
1,430 Expert 1GB
If PartNumber is numeric, you don't need the extra single quotes, if it is text,you do need them.

I would be very very very suspicious of how Access would handle those square brackets in Q[-]shortages. Change the name of your query simply to QShortages. Square brackets are normally used to indicate that 2 words are to be treated as one, so you can't use Last Name, but you can use [Last Name]

Sorry to go on, but "name" is a reserved word, and should not be used as the name of a field in any table. Don't know what you are after but FacilityName is perfectly acceptable.

Another reserved word that frequently causes trouble is "Date"

Expand|Select|Wrap|Line Numbers
  1. DLookUp("FacilityName","QShortages","ItemNumber=" & [PartNumber]) AS Facility
  2.  
May 30 '16 #2
dago87
2
Thank you for fast reply, but sadly none of your suggestion have helped.
PartNumber is text field.
There has to be error somewhere in those double/single quotes.
Expand|Select|Wrap|Line Numbers
  1. 'Q[-]shortages.ItemNumber=1010'"
May 30 '16 #3
PhilOfWalton
1,430 Expert 1GB
You haven't got rid of those square brackets

Phil
May 30 '16 #4
PhilOfWalton
1,430 Expert 1GB
Try
Expand|Select|Wrap|Line Numbers
  1. DLookup ("Name", "QShortages", "ItemNumber = " & Chr$(34) & PartNumber & Chr$(34))
  2.  
Chr$(34) is always much clearer than a string of single & double quotes

Phil
May 30 '16 #5
NeoPa
32,556 Expert Mod 16PB
@Dago.
Your code and the error message simply don't match. One of them must be wrong.

Please check the details of your question before posting.

Please update the question with the correction(s) required.
May 30 '16 #6

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

Similar topics

0
by: alexz | last post by:
valuA = (request.form("toadd")) If valuA = "" then SQL = "UPDATE CourseReg SET attended='Active' WHERE ID IN("&request.form("toadd")&")" Set RS = MyConn.Execute(SQL) End If MyConn.Close Set...
29
by: shank | last post by:
1) I'm getting this error: Syntax error (missing operator) in query expression on the below statement. Can I get some advice. 2) I searched ASPFAQ and came up blank. Where can find the "rules"...
4
by: khan | last post by:
getting, error, 3075 Syntax Error (Missing Operator) in query expression '8WHERE .=1' Dim TotalQty As Integer TotalQty = DLookup("", "", "=" & Forms!!)
3
by: william | last post by:
Hello Everyone, I'm using Access 2000. I entered the following code to do some data validation, however it is not working. I'm trying to ensure that the user cannot enter a duplicate inspection...
2
by: sfrvn | last post by:
I am embarrassed to say I cannot make this work. Recently upgraded to Access 2003, but do not know if that part of problem (AKA 'syntax change'). Would someone be kind enough to lead me by the...
3
by: access baby | last post by:
I hava a date parameter filter query but it shows error Syntax error missing operator in query experssion can some one please help where am i going wrong in expression SELECT copyorderdtl * ...
2
by: Lumpy | last post by:
Hi all, I am having a problem with a line of code in access vba. I am trying to use the DLookup function to check whether or not a record already exists with a dealer name. Once I know if it...
2
by: Dilip Krishnan | last post by:
Syntax error (missing operator) in query expression 'Serial Number = 'L3FW341''. The Serial Number field is declared as text in Access Db. I am not sure which operator is missing in my command! ...
2
by: pptechs | last post by:
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.