Runtime error 3075 Missing Operator

J

JohnW

I am receiving the above error on the following code:

SQL = "update sop10200 set sopnumbe = '" & ChinaOrd & "' from sop10200 " & _
"where sopnumbe = '" & SopNumber & "'"

docmd.runsql SQL

sop10200 is a linked SQL table

ChinaOrd and SopNumber are string variables

Any help is greatly appreciated.

JohnW
 
D

Douglas J. Steele

Remove the "from sop10200":

SQL = "Update sop10200 Set sopnumbe = '" & ChinaOrd & "' " & _
"Where sopnumbe = '" & SopNumber & "'"
 
M

Marshall Barton

JohnW said:
I am receiving the above error on the following code:

SQL = "update sop10200 set sopnumbe = '" & ChinaOrd & "' from sop10200 " & _
"where sopnumbe = '" & SopNumber & "'"

docmd.runsql SQL

sop10200 is a linked SQL table

ChinaOrd and SopNumber are string variables


Try:

SQL = "update sop10200 set sopnumbe = '" & ChinaOrd & "' " _
& "where sopnumbe = '" & SopNumber & "'"
 
J

JohnW

Douglas and Marshall,

Thank you for your response. Unfortunately, when I remove the from clause I
get a different error:

Runtime Error 3157

The column prefix SOP10200 does not match with a table or alias name used in
the query.

Any thoughts?

John
 
D

Douglas J. Steele

Before the line of code

docmd.runsql SQL

put

Debug.Print SQL

When you code runs (and fails), go to the Immediate Window (Ctrl-G) and copy
what's showing there into your response.
 

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

Top