I have a simple problem that has me stumped.
I'm trying to add data to a table with an input into Sql string. I get a syntax error missing operator in the query expression '25r1'.
25r1 is the value of strCN.
lngID is a number, the other items are strings.
From the immediate window I get strSql =
INSERT INTO [tblSubmittalInfo] ( [SerialNumber], [ContractorNumber], [Reviewer] )Values(397, 25r1, Roberto Salinas );
I'm trying to add data to a table with an input into Sql string. I get a syntax error missing operator in the query expression '25r1'.
25r1 is the value of strCN.
lngID is a number, the other items are strings.
Code:
strSql = "INSERT INTO [tblSubmittalInfo] ( [SerialNumber], [ContractorNumber], [Reviewer] )Values(" & lngID & ", " & strCN & ", " & Me.Reviewer & " );"
Debug.Print strSql
From the immediate window I get strSql =
INSERT INTO [tblSubmittalInfo] ( [SerialNumber], [ContractorNumber], [Reviewer] )Values(397, 25r1, Roberto Salinas );