riccaldwell
Technical User
I am trying to create a survey in a Word form and dump the values in to an Access table. Following is a part of the code from my module to load the responses (in this case only question 1). I get a 3134 "Syntax error in INSERT INTO statement" error on any one of the 3 ways I tried to run the SQL. I'm not a programmer; really just one of those users that drive you real programmers nuts. Any ideas will be greatly appreciated.
' Load the DB using SQL statements
' Open Access database
With appAccess
.OpenCurrentDatabase "C:\My Documents\CD_V4.mdb", False
.Visible = True
'.DoCmd.OpenForm "class entry form" 'db connectivity test purposes
'Load Response to Question 1
' .DoCmd.RunSQL "INSERT INTO User_Survey (User_ID, Course_Num, Date, Session, Surv_Quest_ID, Comment) VALUES(strUserID, strCourseAttended, strCourseDate, intSession, intQID1, strEL1_Q1_Comments)"
' .DoCmd.RunSQL "INSERT INTO User_Survey (User_ID, Course_Num, Date, Session, Surv_Quest_ID, Comment) VALUES ('" & strUserID & "','" & strCourseAttended & "','" & strCourseDate & "','" & intSession & "','" & intQID1 & "','" & strEL1_Q1_Comments & "')"
' .DoCmd.RunSQL "INSERT INTO User_Survey (User_ID, Course_Num, Date, Session, Surv_Quest_ID, Comment) VALUES (" & strUserID & "," & strCourseAttended & "," & strCourseDate & "," & intSession & "," & intQID1 & "," & strEL1_Q1_Comments & "
"
No matter which I uncomment, I get the aforementioned error.
' Load the DB using SQL statements
' Open Access database
With appAccess
.OpenCurrentDatabase "C:\My Documents\CD_V4.mdb", False
.Visible = True
'.DoCmd.OpenForm "class entry form" 'db connectivity test purposes
'Load Response to Question 1
' .DoCmd.RunSQL "INSERT INTO User_Survey (User_ID, Course_Num, Date, Session, Surv_Quest_ID, Comment) VALUES(strUserID, strCourseAttended, strCourseDate, intSession, intQID1, strEL1_Q1_Comments)"
' .DoCmd.RunSQL "INSERT INTO User_Survey (User_ID, Course_Num, Date, Session, Surv_Quest_ID, Comment) VALUES ('" & strUserID & "','" & strCourseAttended & "','" & strCourseDate & "','" & intSession & "','" & intQID1 & "','" & strEL1_Q1_Comments & "')"
' .DoCmd.RunSQL "INSERT INTO User_Survey (User_ID, Course_Num, Date, Session, Surv_Quest_ID, Comment) VALUES (" & strUserID & "," & strCourseAttended & "," & strCourseDate & "," & intSession & "," & intQID1 & "," & strEL1_Q1_Comments & "
No matter which I uncomment, I get the aforementioned error.