I have a form that the user fills their information into. Then I want to take that information and put it into a new row on an existing table, however, when I try to run the code I get "syntax error in INSERT INTO statement." I am not sure what I am doing wrong. The date_of_request, first_avail_date, and mand_comp_date fields are dates, the facility, requester, industry_standard, and test_type fields are strings and the rest of the fields are numbers. If anyone has any ideas as to where the syntax error is, I would greatly appreciate the input.
stdbName = "H:\Access\SelfServeTestSchedule.mdb"
Dim stSQL As String
Dim rs As ADODB.Recordset
Set rs = New ADODB.Recordset
Dim cn As ADODB.Connection
Set cn = New ADODB.Connection
cn.Provider = "Microsoft.Jet.OLEDB.4.0"
cn.Open stdbName
stSQL = "INSERT INTO TestInfoTable (test_num, project_num, facility, requester, " & _
"date_of_request, first_avail_date, mand_comp_date, device_s/n, industry_standard, " & _
"test_type, man_dur, mach_dur) VALUES (test_num, TextBox5.Value, 'SMKE', " & _
"'ComboBox2.Value', #TextBox6.Value#, #beg_date#, #comp_date#, TextBox9.Value, " & _
"TextBox10.Value, 'test_type', 0, 0);"
cn.Execute stSQL
stdbName = "H:\Access\SelfServeTestSchedule.mdb"
Dim stSQL As String
Dim rs As ADODB.Recordset
Set rs = New ADODB.Recordset
Dim cn As ADODB.Connection
Set cn = New ADODB.Connection
cn.Provider = "Microsoft.Jet.OLEDB.4.0"
cn.Open stdbName
stSQL = "INSERT INTO TestInfoTable (test_num, project_num, facility, requester, " & _
"date_of_request, first_avail_date, mand_comp_date, device_s/n, industry_standard, " & _
"test_type, man_dur, mach_dur) VALUES (test_num, TextBox5.Value, 'SMKE', " & _
"'ComboBox2.Value', #TextBox6.Value#, #beg_date#, #comp_date#, TextBox9.Value, " & _
"TextBox10.Value, 'test_type', 0, 0);"
cn.Execute stSQL