I have a query constructed to update to table tQA. My problem is that both the Question and Answer fields are character string. The Execute complete with no error when both Question and Answer fields conatin no '"' (double quote) character, however when any of them conatin the double quote character, I get a syntax error in query expression.
strSQLnew = "UPDATE tQA SET Question = """ & oRS![Question] & """, " & "Answer = """ _
& oRS![Answer] & """, " & "Comments = """ & oRS![Comments] & """" _
& " WHERE ID = " & oRS![ID]
CurrentProject.Connection.Execute strSQLnew
How can I avoid such error? Is there another way to construct and execute a query that allows the " as part of the value of the field?
strSQLnew = "UPDATE tQA SET Question = """ & oRS![Question] & """, " & "Answer = """ _
& oRS![Answer] & """, " & "Comments = """ & oRS![Comments] & """" _
& " WHERE ID = " & oRS![ID]
CurrentProject.Connection.Execute strSQLnew
How can I avoid such error? Is there another way to construct and execute a query that allows the " as part of the value of the field?