I want to put this sql update statement into code but keep getting syntax errros. It works in a query but in sql I have to change all the double quotes to singles and I'm missing something somewhere.
strSql = "UPDATE TEMP SET TEMP.CUMMW = DSum('mw','dispatch_all','[totdispatch]<= " & [TotDispatch] & " and [cntrl_area]<='" & [CNTRL_AREA] & "' and [season]<='" & [SEASON] & "' and [year]<= " & [YEAR] & " and [casename] <= '" & [CaseName] & "')"
Debug.Print strSql
DoCmd.RunSQL strSql
strSql = "UPDATE TEMP SET TEMP.CUMMW = DSum('mw','dispatch_all','[totdispatch]<= " & [TotDispatch] & " and [cntrl_area]<='" & [CNTRL_AREA] & "' and [season]<='" & [SEASON] & "' and [year]<= " & [YEAR] & " and [casename] <= '" & [CaseName] & "')"
Debug.Print strSql
DoCmd.RunSQL strSql