473,387 Members | 1,590 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.

Runtime 3075 (syntax error) missing operator

Hello - I'm getting a run time error 3075 (missing operator) in my query expression and cannot seem to determine why. I cut a snippet of code (see below) and ran the statement in a sql query view and it returned the values back as perfectly. However, I get the qdf.SQL = strSQL debug for this statement when I try an run it in a form:

'Set the final Query Statemnt
strSQL = "SELECT * FROM wktbl_YTDTransactions Where " & strQuery & ";"

I'm lost. Any ideas as to what could be missing? Any responses are greatly appreciated
Mar 12 '12 #1
3 1958
Rabbit
12,516 Expert Mod 8TB
That depends on what's in strQuery.
Mar 12 '12 #2
Thanks for the reply. Here is an excerpt of the code along with the statement with strQuery:

Expand|Select|Wrap|Line Numbers
  1. strQuery = strQuery & "wktbl_YTDTransactions!" & tCtrl.ControlSource & " IN(" & strCriteria & ")"
  2.                 strQuery = strQuery & " AND "
  3.             End If
  4.  
  5.         End If
  6.  
  7.       Next tCtrl
  8.  
  9.     'Trim the last AND off the strQuery or it will throw an error
  10.      strQuery = Left(strQuery, Len(strQuery) - 5)
  11.  
  12.      'Set the final Query Statemnt
  13.      strSQL = "SELECT * FROM wktbl_YTDTransactions Where " & strQuery & ";"
  14.  
  15.      qdf.SQL = strSQL
  16.  
  17.      DoCmd.OpenQuery "sysqry_YTDTransactions Query"
Mar 12 '12 #3
Rabbit
12,516 Expert Mod 8TB
Please use code tags.

It now depends on what's in strCriteria. Why do you keep leaving out information that we need?

Also, what is "wktbl_YTDTransactions!"? If it's a table, you can't use the exclamation mark. If it's a form control, you forgot the Form! in front.
Mar 12 '12 #4

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

Similar topics

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...
1
by: Alan Murrell | last post by:
Hello, One of our web hosting clients is getting the following error when someone tried to log in form their login page: --- ODBC ERROR --- Microsoft OLE DB Provider for ODBC Drivers error...
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: chug | last post by:
I'm not a programmer but it's my job to solve this. Can someone help me with this error message? Microsoft OLE DB Provider for ODBC Drivers error '80040e14' Syntax error (missing operator)...
3
by: BigGuy316 | last post by:
Here is the error message I am getting along with the code: Error Type: Microsoft JET Database Engine (0x80040E14) Syntax error (missing operator) in query expression 'IDFrm = 38 AND IDSpec ='....
10
by: kabradley | last post by:
Hey guys, I'm using an embedded sql statement tied to a command button to append records in a certain table. The code for the sql statement is as follows. 'Define sql string strSQL = "INSERT INTO...
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: aaron6098 | last post by:
I am trying to finish my final project for my programing class. i keep on getting Error Type: Microsoft OLE DB Provider for ODBC Drivers (0x80040E14) Syntax error (missing operator) in query...
4
by: munkee | last post by:
I am trying to dynamically update the rowsource of a chart within access. To achieve this I moved the original rowsource sql of the chart which is: SELECT tblParetoRaising.NCType,...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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...

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.