473,379 Members | 1,330 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,379 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 1820
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
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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
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
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.