I am using the following VBA code to update a Double field in my db. The name of the field is week
and the name of the value to put on is valore
. In my VBA they are both String
variable.
When valore
is a number without decimal (es. "15"), I have no problem.
When valore
is a number with decimal (es. "2.5" or "2,5"), I get the following error:
Syntax error in UPDATE statement
CurrentDb.Execute "UPDATE [Pianificazione risorse] " _
& "SET " & week & " = " & CDbl(valore) & " " _
& "WHERE [Codice Progetto] = '" & xCodice_Progetto & "' AND Risorsa = '" & xRisorsa & "';"