Solved Syntax error (1 Viewer)

Versus

New member
Local time
Today, 03:49
Joined
May 24, 2020
Messages
5
I'm having problems with Syntax of SQL strings, what is wrong in this string

Dim Localizacao As String
Dim Patrimonio As String

Localizacao = Me.txt_localoculto
Patrimonio = Me.txt_patrimonio

Comando = "UPDATE FROM tabela_ferramentas SET Local = '" & Localizacao & "'" WHERE PatrimonioFerramenta = '" & Patrimonio & "'"

I would also like to know where I can study to learn more about these indentation problems with SQL Strings, thank you all for your attention. (y)
 

June7

AWF VIP
Local time
Yesterday, 22:49
Joined
Mar 9, 2014
Messages
5,470
FROM is not appropriate in UPDATE. There is an extra quote mark in front of WHERE. Always make sure quotes and apostrophes are in pairs - an even number by counting.
 

cheekybuddha

AWF VIP
Local time
Today, 07:49
Joined
Jul 21, 2014
Messages
2,276
Code:
Comando = "UPDATE FROM tabela_ferramentas SET Local = '" & Localizacao & "'" WHERE PatrimonioFerramenta = '" & Patrimonio & "'"
                   ^                                                       ^
                   |                                                       |
            INCORRECT SYNTAX                                     Extra double quote here

Comando = "UPDATE tabela_ferramentas SET Local = '" & Localizacao & "' WHERE PatrimonioFerramenta = '" & Patrimonio & "'"

(Sorry, June, I only read your response after I hit 'Post' :oops: )

hth,

d
 

Users who are viewing this thread

Top Bottom