Can someone take a look at the below SQL 'INSERT INTO' statement ? I'm trying to insert multiple variable values into an 'INSERT INTO' statement. I'm getting the below error message. The code is listed below. I started out with two (2) variables, but will have thirteen to insert into a table. Also, in the code below is the VBA statement to retrieve the variable data. I'm getting the data, but cannot insert the data into the table. Thanks ! ! !
**********************************************************
Private Sub Test2_Click()
Dim strSQL As String
Dim strSalesman As String
Dim strContentArea As String
DoCmd.SetWarnings False
strSalesman = Forms![Salesman Evaluation - Form B]![Salesman].Column(0)
strContentArea = Forms![Salesman Evaluation - Form B]![Content Area].Column(0)
strSQL = "INSERT INTO [Sales Evaluations] (Salesman, Content_Areas) VALUES ('" & strSalesman & "',strContentArea)"
Debug.Print strSQL
CurrentDb.Execute strSQL, dbFailOnError
End Sub
Error
Microsoft Visual Basic popup
Run-time error '3061'
Too few parameters. Expected 1.
*********************************************************
**********************************************************
Private Sub Test2_Click()
Dim strSQL As String
Dim strSalesman As String
Dim strContentArea As String
DoCmd.SetWarnings False
strSalesman = Forms![Salesman Evaluation - Form B]![Salesman].Column(0)
strContentArea = Forms![Salesman Evaluation - Form B]![Content Area].Column(0)
strSQL = "INSERT INTO [Sales Evaluations] (Salesman, Content_Areas) VALUES ('" & strSalesman & "',strContentArea)"
Debug.Print strSQL
CurrentDb.Execute strSQL, dbFailOnError
End Sub
Error
Microsoft Visual Basic popup
Run-time error '3061'
Too few parameters. Expected 1.
*********************************************************