473,729 Members | 2,301 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

"Syntax Error (missing operator) in query expression"

Hi

I have the following error message "Syntax Error (missing operator)
in
query expression" occurring when I am trying to update combo box
within a form.
My code is:
Dim strSQL As String
Me.DESCRIPTION. Value = ""
strSQL = "SELECT DISTINCT [Description] FROM tblAnzsic_Codes _Info
WHERE Industry = '" & Me.INDUSTRY & "' AND Sub_Division = '" &
Me.SUB_DIVISION & "' AND Group = '" & Me.GROUP & "'"
Me.DESCRIPTION. RowSource = strSQL
This code is produce a list in the "Descriptio n" combo box based upon
the values selected in the previous combo boxes.
Any help would be appreciated.

Sep 28 '07 #1
4 14999
On 28 Set, 03:58, thebarefootnat. ..@googlemail.c om wrote:
Hi

I have the following error message "Syntax Error (missing operator)
in
query expression" occurring when I am trying to update combo box
within a form.

My code is:
Dim strSQL As String

Me.DESCRIPTION. Value = ""
strSQL = "SELECT DISTINCT [Description] FROM tblAnzsic_Codes _Info
WHERE Industry = '" & Me.INDUSTRY & "' AND Sub_Division = '" &
Me.SUB_DIVISION & "' AND Group = '" & Me.GROUP & "'"
Me.DESCRIPTION. RowSource = strSQL

This code is produce a list in the "Descriptio n" combo box based upon
the values selected in the previous combo boxes.

Any help would be appreciated.


Try placing quotes around strSQL and also
enclosing Group in brackets: [Group].

(There might be other unbalanced stuff. Did not try it)

Me.DESCRIPTION. RowSource = strSQL does not look right (unless you want
a boolean there)
perhaps you meant & "DESCRIPTION="" " & strSQL & """" (?)

-P
----------------------------------------------------------------------
Acces Reports / Dashboards / Charts / Alerts ...
http://groups.google.it/group/DataTime

Sep 28 '07 #2
th************* **@googlemail.c om wrote in
news:11******** *************@2 2g2000hsm.googl egroups.com:
Hi

I have the following error message "Syntax Error (missing
operator)
in
query expression" occurring when I am trying to update combo box
within a form.
My code is:
Dim strSQL As String
Me.DESCRIPTION. Value = ""
strSQL = "SELECT DISTINCT [Description] FROM tblAnzsic_Codes _Info
WHERE Industry = '" & Me.INDUSTRY & "' AND Sub_Division = '" &
Me.SUB_DIVISION & "' AND Group = '" & Me.GROUP & "'"
Me.DESCRIPTION. RowSource = strSQL
This code is produce a list in the "Descriptio n" combo box based
upon
the values selected in the previous combo boxes.
Any help would be appreciated.
If the strSQL definition is all on one line it should work. (I can't
tell from here as my reader wraps text.)

Before setting the rowsource, do a debug,print strSQL. that will
show the string in the immediate window, {Ctrl-G} to make it visible
and examine the string to see if there are any missing spaces, or
other issues.

--
Bob Quintal

PA is y I've altered my email address.

--
Posted via a free Usenet account from http://www.teranews.com

Sep 28 '07 #3
On Sep 28, 8:17 pm, Bob Quintal <rquin...@sPAmp atico.cawrote:
thebarefootnat. ..@googlemail.c om wrote innews:11****** *************** @22g2000hsm.goo glegroups.com:


Hi
I have the following error message "Syntax Error (missing
operator)
in
query expression" occurring when I am trying to update combo box
within a form.
My code is:
Dim strSQL As String
Me.DESCRIPTION. Value = ""
strSQL = "SELECT DISTINCT [Description] FROM tblAnzsic_Codes _Info
WHERE Industry = '" & Me.INDUSTRY & "' AND Sub_Division = '" &
Me.SUB_DIVISION & "' AND Group = '" & Me.GROUP & "'"
Me.DESCRIPTION. RowSource = strSQL
This code is produce a list in the "Descriptio n" combo box based
upon
the values selected in the previous combo boxes.
Any help would be appreciated.

If the strSQL definition is all on one line it should work. (I can't
tell from here as my reader wraps text.)

Before setting the rowsource, do a debug,print strSQL. that will
show the string in the immediate window, {Ctrl-G} to make it visible
and examine the string to see if there are any missing spaces, or
other issues.

--
Bob Quintal

PA is y I've altered my email address.

--
Posted via a free Usenet account fromhttp://www.teranews.co m- Hide quoted text -

- Show quoted text -
Hi,

I tried using the quotes around strSQL and brackets around Group but
it don't work.

My str SQL code is all one line.

Dim strSQL As String

Me.DESCRIPTION. Value = ""
strSQL = "SELECT DISTINCT [Description] FROM tblAnzsic_Codes _Info
WHERE Industry = '" & Me.INDUSTRY & "' AND Sub_Division = '" &
Me.SUB_DIVISION & "' AND Group = '" & Me.GROUP & "'"
Me.DESCRIPTION. RowSource = strSQL

Any other ideas?

Thanks

Oct 1 '07 #4
On Oct 1, 1:18 am, thebarefootnati on
<thebarefootnat ...@googlemail. comwrote:
Any other ideas?
The problem seems to be caused by having a field called "Group" in
your table. I made a test form with two textboxes and a combobox and
got the same error you got. When I changed the table design field
name to theGroup and changed the references on the form appropriately
the RowSource worked. Note: I put the RowSource change in the form's
Current event.

James A. Fortune
CD********@Fort uneJames.com

Oct 1 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
4386
by: Petr Prikryl | last post by:
Hi, Summary: In my opinion, the C-like prefix increment and decrement operators (++i and --i) should be marked as "syntax error". Current situation: try... (Python 2.4 (#60, ...)) >>> i = 1 >>> i
5
9540
by: deko | last post by:
After developing an MDB in Access 2003 on WS03, then making it into an MDE and deploying it on a WinXP box with Access 2003 installed, I get this error: Function is not available in expressions in query expression SELECT IIf(IsNull(),"", & Chr(13) & Char(10)) & IIf(IsNull(),"", & Char(13) & Char(10)) & IIf(IsNull(),"", & Char(13) & Char(10)) & IIf(IsNull(),"",] & IIf(IsNull(),"",", ") &
4
5161
by: James | last post by:
Please help me with this sql: SELECT z005aNORTHEAST_3days_Formula.Region, z005aNORTHEAST_3days_Formula.DiffofClaimsAssignment FROM (SELECT .Region, (.)-( .) AS DiffofClaimsAssignment FROM (SELECT .Region, ., ., .
2
2260
by: david | last post by:
Anyone could give me a hand about this syntax error? Thank you. David Source Code: Dim conn As New SqlConnection(strConn) Dim daAngio As New SqlDataAdapter(strSelectStatement, conn) 'Create a dataset Dim dsAngio As New DataSet 'fill in the dataset by adapter daAngio.Fill(dsAngio, "AngioInfo") Dim ok As Boolean = False
13
27438
by: hn.ft.pris | last post by:
Hi: I have the following simple program: #include<iostream> using namespace std; int main(int argc, char* argv){ const double L = 1.234; const int T = static_cast<const int>(L); int arr;
2
9045
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 hand? Table name: LUtblProvider Table field names: provPKID, name, company, type, phone Table name: tblRef Table field names: refPKID, prov, event, src
7
4625
by: luttkens | last post by:
I used to have no problems using IF-statement in SQL-queries. Now nothing works, it always returns "Syntax error". This query also returns an error. IF (1=1) THEN SELECT 'True' ELSE SELECT 'False' END IF What is wrong? I know it doesn't do anything, but why do I get syntax error?
2
2354
by: RAG2007 | last post by:
Hi, I'm running an ADP with SQL Server as back end. On a main form, my subform is coming up blank. When I was running as an mdb with no back end I didn't have this problem. I get an error "Syntax error access violation", and the subform is all white, not even any empty fields. I'm not even sure where to begin to look for the issue. Thanks, any help is appreciated.
0
1624
by: Daniel Halvorse | last post by:
hi I am working on an application that manages the data in a access database. but i cant seem to get past this error. When i try to run it it says: "Syntax error in INSERT INTO statement" syntax error, I have made all the fields in database TEXT(255) so it cant be that. any help regarding this will be much appreciated, i am new to datasets and would love any help or guides i can get on the matter. ...
0
8921
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8763
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
9202
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9148
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8151
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6722
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6022
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
3238
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2683
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.