Just to clarify, the code that namliam submitted was
Code:Currentdb.querydefs("qryBetweenDates").sql = strSQL
But you listed
Code:CurrentDb.QueryDefs("qry[B][COLOR=red]MTO[/COLOR][/B]BetweenDates").SQL = strSQL
Which is fine as long as the query you have created is named "qryMTOBetweenDates". The error you are reporting leads me to think otherwise.
Oh yeah, no thats ok query is named qryMTOBetweenDates
One of the things that don't seem clear to me is whats the point on creating a new query (?), is it an empty query? what am I supposed to put in it? If I use that query for populating my report what am I supposed to set as record source for the report fields ??? lots of questions...