error 3075- Syntax error

A

ajbarilla

I am trying to insert new records in a table with the following code:

QrySQL = ("insert into [tbl3] (document) select [testtbl].[field2]
WHERE [testtbl].[Field1]= '" & searchcrit & "'")
db.Execute QrySQL, dbFailOnError

but keep getting the following error: "Error 3075-Syntax error
(missing operator) in query expression.

its obviously an error with my syntax but im not sure where it is.
searchcrit is a string.

any help is appreciated
 
D

Douglas J. Steele

You're missing "FROM testtbl " in your SQL:

QrySQL = "insert into [tbl3] (document) select [testtbl].[field2] " & _
"FROM testtbl WHERE [testtbl].[Field1]= '" & searchcrit & "'"
 

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