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]);"
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]);"
Comment