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

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 tblStudentMaster.[Last Name] AS LastName,
tblStudentMaster.[First name] AS FirstName, tblStudentMaster.StudentID,
tblStudentMaster.status, tblStudentMaster.Month,
tblStudentMaster.[Start Date] AS StartDate, tblStudentMaster.YearX,
tblStudentMaster.Month, MonthNumber([Month]) AS MonthNbr, *" _
& " FROM tblStudentMaster" _
& " WHERE (((tblStudentMaster.StudentID) = " & StudentIDData & ")" _
& " And ((tblStudentMaster.Month) = """ & Me![ChooseMonth] & """)" _
& " And ((tblStudentMaster.YearX) = """ & Me![ChooseYear] & """))" _
& " Or (((tblStudentMaster.StudentID) = " & StudentIDData & ")" _
& " And ((tblStudentMaster.YearX) > """ & Me![ChooseYear] & """))" _
& " Or (((tblStudentMaster.StudentID) = " & StudentIDData & ")" _
& " And ((tblStudentMaster.YearX) = """ & Me![ChooseYear] & """)" _
& " And ((MonthNumber(tblStudentMaster.[Month])) > " & "MonthNumber("""
& Me![ChooseMonth] & """)))" _
& " ORDER BY tblStudentMaster.YearX, MonthNumber([Month]);"

May 5 '06 #1
7 1821
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 Expert 8TB
Is MonthNumber(<MonthName>) a Public Function?
May 5 '06 #5
"Chucky" <cb******@optonline.net> wrote in
news:11**********************@i39g2000cwa.googlegr oups.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(tblStudentMaster.[Month])) > " & "MonthNumber
(""" & Me![ChooseMonth] & """)))" _

has excessive parentheses and some superfluous quotes. You are also
missing an underscore at the end of the upper line.
& " And MonthNumber(tblStudentMaster.[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******@optonline.net> wrote in
news:11**********************@g10g2000cwb.googlegr oups.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
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!!)
2
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...
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...
4
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
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: 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
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...
0
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...

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.