Thanks, sorted.
"Duane Hookom" wrote:
[Quoted Text] > Try this: > > Do While currentDate <= tempFinish > strSQL = "UPDATE Forecast " & _ > "SET [totalValue] = [totalValue] + " & dailyValue & _ > " WHERE [calDate]=#" & Format(currentDate, "mm/dd/yyyy") & "#" > cmd.CommandText = strSQL > Debug.Print strSQL > cmd.Execute > currentDate = currentDate + 1 > Loop > > -- > Duane Hookom > MS Access MVP > > "David M C" <DavidMC[ at ]discussions.microsoft.com> wrote in message > news:DD657682-4A3C-44B4-BDC1-E8CF7E831777[ at ]microsoft.com... > > Here's my code: > > > > Do While currentDate <= tempFinish > > strSQL = "UPDATE Forecast SET Forecast.totalValue = ""totalValue"" > > +" & dailyValue & " WHERE (((Forecast.calDate)=#" & Format(currentDate, > > "mm/dd/yyyy") & "#));" > > cmd.CommandText = strSQL > > Debug.Print strSQL > > cmd.Execute > > currentDate = currentDate + 1 > > Loop > > > > And here's the strSQL output in the immediate window: > > > > UPDATE Forecast SET Forecast.totalValue = "totalValue" +263.4528 WHERE > > (((Forecast.calDate)=#01/01/2006#)); > > > > However, I get a "data type mismatch in criteria expression" error. I > > don't > > get this error if I remove the #'s, but none of the fields get updated. > > Any > > ideas? > > > > Thanks, > > > > Dave > > >
|