Link to home
Start Free TrialLog in
Avatar of Sandra Smith
Sandra SmithFlag for United States of America

asked on

Error 2501 when executing a VBA query

I have been creating the queries from the Access 2003 database design view, then copy the code into my procedures once I am sure they give me the results I want.  This has been working fine until now.  The below is the code I copied from a working query but now when I try to run it in the procedure, I get a Runtime 2501 error, RUnSQL was canceled.  The only modificiation was changing the " to '.  Any suggestions?  

strMakeTable = "SELECT tblWeeklyUpload.AssignmentDate, tblWeeklyUpload.DateWorkedOn, " & _
               "tblWeeklyUpload.Lots, IIf([Transcode]='JNL','JNL (2)','') AS TranCode, " & _
               "[DateWorkedOn]-[tblWeeklyUpload.AssignmentDate] AS DaysDiff, tblSLA.SLA, " & _
               "IIf([SLA]>=[DaysDiff],'Yes','No') AS Met, tblSPCQualityControl.IndiaRanking,  " & _
               "tblSPCQualityControl.Ranking AS SFReviewRanking INTO tblIndiaJNLMetrics " & _
               "FROM (tblWeeklyUpload LEFT JOIN tblSLA ON tblWeeklyUpload.TransCode = tblSLA.ReturnMethod) " & _
               "LEFT JOIN tblSPCQualityControl ON tblWeeklyUpload.Account = tblSPCQualityControl.Account " & _
               "WHERE (((tblWeeklyUpload.AssignmentDate) Between [FORMS]![frmMenuManagementIndia].[txtStart] " & _
               "And [FORMS]![frmMenuManagementIndia].[txtEnd]) AND ((tblWeeklyUpload.TransCode)= 'JNL') AND " & _
               "((tblWeeklyUpload.EditTeam)='India')) "
ASKER CERTIFIED SOLUTION
Avatar of Gustav Brock
Gustav Brock
Flag of Denmark image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Did you get this working?