By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,477 Members | 1,641 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,477 IT Pros & Developers. It's quick & easy.

Missing Operator In Query Expression

P: n/a
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
Share this Question
Share on Google+
7 Replies


P: n/a
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

P: n/a
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

P: n/a
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
Expert 5K+
P: 8,597
Is MonthNumber(<MonthName>) a Public Function?
May 5 '06 #5

P: n/a
"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

P: n/a
Thanks Bob, It works Fine Now !!!!!

May 6 '06 #7

P: n/a
"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 discussion thread is closed

Replies have been disabled for this discussion.