Update sintax error

  • Thread starter Thread starter Rodolfo Fontes
  • Start date Start date
R

Rodolfo Fontes

Hi group,

Is there anything wrong with this statment?

DoCmd.RunSQL "UPDATE [T Tabela_de_Precos] SET [T Tabela_de_Precos].Valor_FN
= " & rs_prod!Total & " WHERE (([T Tabela_de_Precos].CodProd) = " &
rs_prod!CodProd & ");"

Another question...
On Sql commands, is there any document with how can i do it using using
variables that are on the code?

Thanks,
Rodolfo Fontes
 
If Valor_FN and CodProd fields are numeric fields, then this should work.

However, if they are text fields, you must delimit the values you're
concatenating into the string with ' characters:

DoCmd.RunSQL "UPDATE [T Tabela_de_Precos] SET [T Tabela_de_Precos].Valor_FN
= '" & rs_prod!Total & "' WHERE (([T Tabela_de_Precos].CodProd) = '" &
rs_prod!CodProd & "');"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top