473,549 Members | 2,545 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Missing Operator In Query Expression

I have been going crazy slowly all week. When I step through my code I
get Run Time Error 3075, Syntax error, Missing Operator in Query
Expression. I think that I have narrowed the error down to the next to
last line of the following code, where the function MonthNumber is
used. The fields that start with 'Choose' are fields on a form.
StudentIDData is a variant. Can anybody help???? Please

StrSQL = " SELECT tblStudentMaste r.[Last Name] AS LastName,
tblStudentMaste r.[First name] AS FirstName, tblStudentMaste r.StudentID,
tblStudentMaste r.status, tblStudentMaste r.Month,
tblStudentMaste r.[Start Date] AS StartDate, tblStudentMaste r.YearX,
tblStudentMaste r.Month, MonthNumber([Month]) AS MonthNbr, *" _
& " FROM tblStudentMaste r" _
& " WHERE (((tblStudentMa ster.StudentID) = " & StudentIDData & ")" _
& " And ((tblStudentMas ter.Month) = """ & Me![ChooseMonth] & """)" _
& " And ((tblStudentMas ter.YearX) = """ & Me![ChooseYear] & """))" _
& " Or (((tblStudentMa ster.StudentID) = " & StudentIDData & ")" _
& " And ((tblStudentMas ter.YearX) > """ & Me![ChooseYear] & """))" _
& " Or (((tblStudentMa ster.StudentID) = " & StudentIDData & ")" _
& " And ((tblStudentMas ter.YearX) = """ & Me![ChooseYear] & """)" _
& " And ((MonthNumber(t blStudentMaster .[Month])) > " & "MonthNumber("" "
& Me![ChooseMonth] & """)))" _
& " ORDER BY tblStudentMaste r.YearX, MonthNumber([Month]);"

May 5 '06 #1
7 1830
Chucky:

One quick question:
Is MonthNumber a custom function you have in your db? Does it do
anything different than the built in Month function?

Jana

May 5 '06 #2
Jana,

MonthNumber returns a number when the argument is the MonthName. I
created it and it resides in a module

Chuck

May 5 '06 #3
Jana,

MonthNumber returns a number when the argument is the MonthName. I
created it and it resides in a module

Chuck

May 5 '06 #4
ADezii
8,834 Recognized Expert Expert
Is MonthNumber(<Mo nthName>) a Public Function?
May 5 '06 #5
"Chucky" <cb******@opton line.net> wrote in
news:11******** **************@ i39g2000cwa.goo glegroups.com:
I have been going crazy slowly all week. When I step through
my code I get Run Time Error 3075, Syntax error, Missing
Operator in Query Expression. I think that I have narrowed the
error down to the next to last line of the following code,
where the function MonthNumber is used. The fields that start
with 'Choose' are fields on a form. StudentIDData is a
variant. Can anybody help???? Please


& " And ((MonthNumber(t blStudentMaster .[Month])) > " & "MonthNumbe r
(""" & Me![ChooseMonth] & """)))" _

has excessive parentheses and some superfluous quotes. You are also
missing an underscore at the end of the upper line.
& " And MonthNumber(tbl StudentMaster.[Month]) " _
& " > MonthNumber(""" & Me![ChooseMonth] & """) " _

--
Bob Quintal

PA is y I've altered my email address.
May 6 '06 #6
Thanks Bob, It works Fine Now !!!!!

May 6 '06 #7
"Chucky" <cb******@opton line.net> wrote in
news:11******** **************@ g10g2000cwb.goo glegroups.com:
Thanks Bob, It works Fine Now !!!!!

It makes me happy to hear that.
--
Bob Quintal

PA is y I've altered my email address.
May 6 '06 #8

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

Similar topics

0
3079
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 RS = Nothing Set MyConn = Nothing
29
2477
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" for when and how to use single quotes and double quotes in ASP? thanks! ---------------------- SQL = SQL & "WHERE '" &...
4
18037
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 on me for some reason. The Summary field is pulled from a Rich Text Editor that allows HTML formatting and appears to be the culprit, but I just...
3
5518
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 subform that uses the same table, is that my problem? If I remove the criteria from the expression, it opens the form, but to show every record.
4
18204
by: khan | last post by:
getting, error, 3075 Syntax Error (Missing Operator) in query expression '8WHERE .=1' Dim TotalQty As Integer TotalQty = DLookup("", "", "=" & Forms!!)
2
1921
by: Shannan Casteel via AccessMonster.com | last post by:
I have a form for users to enter part numbers. The form has 5 text boxes for each part. Part No1 has a text box for the user to enter his part no., along with a description box, price box, a quantity box, and a total box. After the user enters his part number the description and price will appear in their respective boxes. The user then...
2
9028
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...
4
14988
by: thebarefootnation | last post by:
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
0
7526
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...
0
7457
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...
0
7723
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7965
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7483
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...
0
7817
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...
1
5375
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...
0
3504
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1949
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

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.