I am receiving the msg: Syntax error (comma) in query expression. I am sure it's a Stevie Wonder error but I can't see it. The error denotes it is in the Where statement.
Curr_Rgn is defined as a string expression.
strSQL = "SELECT Left([NMAC DIST],2) AS Rgn_cd, EOLDLR.NMAC_SLS_DIST_CD, tblMOR_Report_Recs.NNA_Dlr, " _
& "tblMOR_Report_Recs.FSM, tblMOR_Report_Recs.Last_Access_Date, tblMOR_Report_Recs.DealerName, " _
& "tblMOR_Report_Recs.Access_Count, tblMOR_Report_Recs.RegionName, tblMOR_Report_Recs.Division, " _
& "tblMOR_Report_Recs.StartDate " _
& "FROM EOLDLR INNER JOIN tblMOR_Report_Recs ON EOLDLR.NMC_DLR_NUM = tblMOR_Report_Recs.NNA_Dlr " _
& "WHERE ((left([NMAC Dist]),2) = '" & Curr_Rgn & "') And ((tblMOR_Report_Recs.NNA_Dlr) Is Not Null) And " _
& "((EOLDLR.Status) = 'ACTIVE') " _
& "ORDER BY EOLDLR.NMAC_SLS_DIST_CD, tblMOR_Report_Recs.NNA_Dlr;"
Any Ideas?
Thanx,
Trudye
Curr_Rgn is defined as a string expression.
strSQL = "SELECT Left([NMAC DIST],2) AS Rgn_cd, EOLDLR.NMAC_SLS_DIST_CD, tblMOR_Report_Recs.NNA_Dlr, " _
& "tblMOR_Report_Recs.FSM, tblMOR_Report_Recs.Last_Access_Date, tblMOR_Report_Recs.DealerName, " _
& "tblMOR_Report_Recs.Access_Count, tblMOR_Report_Recs.RegionName, tblMOR_Report_Recs.Division, " _
& "tblMOR_Report_Recs.StartDate " _
& "FROM EOLDLR INNER JOIN tblMOR_Report_Recs ON EOLDLR.NMC_DLR_NUM = tblMOR_Report_Recs.NNA_Dlr " _
& "WHERE ((left([NMAC Dist]),2) = '" & Curr_Rgn & "') And ((tblMOR_Report_Recs.NNA_Dlr) Is Not Null) And " _
& "((EOLDLR.Status) = 'ACTIVE') " _
& "ORDER BY EOLDLR.NMAC_SLS_DIST_CD, tblMOR_Report_Recs.NNA_Dlr;"
Any Ideas?
Thanx,
Trudye