473,387 Members | 1,300 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,387 software developers and data experts.

Syntax Error Missing Operator in query Expression

Expand|Select|Wrap|Line Numbers
  1. WHERE " & 
  2.    IIf(Me.EXAM = 0, 
  3.       "", 
  4.       "EXAMLb.EXAM = " & Me.EXAM & " And ") & 
  5.    IIf(Me.exam_grp = 0, 
  6.       "", 
  7.       "group.type = 2 
  8.          And group.id = " & Me.exam_grp & " 
  9.          And ") & 
  10.    IIf(Nz(Me.work_grp, 0) = 0, 
  11.       "",
  12.        "group.type = 2 
  13.          And group.id = " & 
  14.             Me.work_grp.Column(2) & " And ") &
  15.    "Trim(Nz(link2.RESULT, '')) = '' 
  16. ORDER BY EXAMLb.EXNAME")
Jul 26 '13 #1
3 1206
Got the answer.
Thanks for looking
Jul 26 '13 #2
jimatqsi
1,271 Expert 1GB
I gave up on this style of string building a while ago. It drives me crazy to try to read an expression like this. What helps me keep quotes and commas straight is something like this:
Expand|Select|Wrap|Line Numbers
  1. strwhere = "Where [stringfieldnameX]='\stringfieldnameX\' AND [numericfieldnameY]=\numericfieldnameY\ ... "
  2. strwhere = Replace(strwhere, "\stringfieldnameX\", Me.x)
  3. strwhere = Replace(strwhere, "\numericfieldnameY\", Me.Y)
  4.  
When I started doing that suddenly my code became more readable, less subject to missing quotes, too many quotes etc ....

Jim
Jul 26 '13 #3
zmbd
5,501 Expert Mod 4TB
Please post your solution so that others with a simular question can also benifit from your hard work.
Jul 26 '13 #4

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: dcarson | last post by:
I've read about this error in several other discussions, but still can't seem to pinpoint the problem with my code. Everything seemed to be working fine for some time, but it now tends to bomb out...
3
by: Lumpierbritches | last post by:
Syntax Error (missing operator) in query expression =BLANK'S MOLLIE-PRINCE BRUISER-3/14/2004-03 AnimalID is correct. I'm trying to open with a command button or double click the frmAnimal from a...
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!!)
1
by: Justin R | last post by:
Hey I am really stuck and can't figure out what is wrong here is the code line and surrounding code, if anyone can help i would appreciate it. Thanks This first line is the line that has a problem...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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...

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.