On my form I have a combo box with an On Not In List Event. To insert the new data in to the appropriate table I build up a SQL string as follows:
'Build up the SQL string to add new data.
strSQL = "INSERT INTO [tblMy Table Name]([fldItemName]) " & _
"VALUES ('" & NewData & "');"
I then perform the action
DoCmd.RunSQL strSQL
This works OK until the new data contains and apostrophe eg "Fred's CD". The error message 3075 - Syntax error, missing operator is displayed.
How can I resolve this problem?
Thanking you in advance.
pH