>Here is the whole statement:
>
>SQLText = "UPDATE DISTINCTROW tmpCCBuild01 INNER JOIN tmpComp "
>SQLText = SQLText & "ON (tmpCCBuild01.CustomerID = tmpComp.CustomerID) "
>SQLText = SQLText & "AND (tmpCCBuild01.ProjectID = tmpComp.ProjectID) "
>SQLText = SQLText & "SET tmpComp.C" & RMo & "S = [sales], "
>SQLText = SQLText & "tmpComp.C" & RMo & "SF = [sqft]
>SQLText = SQLText & "WHERE ((tmpCCBuild01.Period='" & sCPer & "')) "
>SQLText = SQLText & "AND tmpCCBuild01.PhaseDate < #" & MaxPhaseDate & "#;"
>
>Set CompQry = CurrDB.CreateQueryDef("qryaMonthData", SQLText)
>CompQry.Execute
>CurrDB.QueryDefs.Delete "qryaMonthData"
>
>
>Can you see what is wrong? Thanks.
>
>Marc
May I ask, where do you get the values for [sales] and [sqft]. This way (within brackets), Access thinks that you are refering to a field where you wish to get data, unless they are parameters.
If they are parameters, you'll have to use the parameters object to set them before running the query.
Hugo Dahl
"My get up and go must've got up and went"
-Steve Tyler, Aerosmith