Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

INSERT INTO Statement Syntax Error Message

Status
Not open for further replies.

jgroh9

Technical User
Jun 13, 2003
17
US
When I try to run the following Append Query I keep getting error message 3075. "Syntax Error(missing operator) in query expression.

Here is the code:
DoCmd.RunSQL "INSERT INTO tblErrors ( ErrorNumber, ErrorDescription ) VALUES(" _
& " '" & strErrNum & "', '" & strErrDesc & "' )"


Does anyone know what the problem might be?

Thanks
 
What is in the "strErrNum" and "strErrDesc" variables?
Are they the correct data type for the underlying table and not null?

John
 
Dim Sql as string

Assign
"INSERT INTO tblErrors ( ErrorNumber, ErrorDescription ) VALUES(" _
& " '" & strErrNum & "', '" & strErrDesc & "' )"

to variable sql

DoCmd.RunSQL sql

when you get the error, goto the immediate window, and type
?sql
You'll see what your passing to the SQL engine. You should see the error.




 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top