Access 2003
Hi All,
I am running the following code - it inserts data from a combobox and a textbox into a table.
I get a "Runtime error 3075 - Syntax error in query expression" error if the txtbox(infotodo) has an apostrophe(') in the txt. I works fine if there is no apostrophe, but as soon as there is one, this error occurs.
eg: "Hello, you are great!" - works fine, but
"Hello, you're great!" - does not work.
I am really stumped and would appreciate any info in the right direction.
Thank you.
Michael
Hi All,
I am running the following code - it inserts data from a combobox and a textbox into a table.
Code:
Dim pid as Integer
Dim infotodo as String
pid = combopid.Value
infotodo = txtboxtodo.Value
DoCmd.RunSQL "insert into info_todo(Priority,info)values ('" & pid & "','" & infotodo & "')"
I get a "Runtime error 3075 - Syntax error in query expression" error if the txtbox(infotodo) has an apostrophe(') in the txt. I works fine if there is no apostrophe, but as soon as there is one, this error occurs.
eg: "Hello, you are great!" - works fine, but
"Hello, you're great!" - does not work.
I am really stumped and would appreciate any info in the right direction.
Thank you.
Michael