A
auujxa2 via AccessMonster.com
I have a strSQL that gives me syntax errors, when someone enters an
apostrophe in the text box as a value. (ie. Men's Clothing)
The apostrophe is messing everything up.. So I don't have to put a (do not
enter apostrophe's in the box) on the form, what type of error handler can
help me? Thank you in advance!!
Here is the code: (i get the error when an apostrophe is entered into rst1
Do Until rst2.EOF
strSQL = "UPDATE [PARStoreData_tbl] SET [Comments] = """ & rst1.
Fields("Comments").Value & """" & _
" WHERE [PARStoreData_tbl].[QAID] = """ & rst.Fields
("NewQAID").Value & rst2.Fields("Comments").Value & """"
DoCmd.RunSQL strSQL
rst2.MoveNext
Loop
apostrophe in the text box as a value. (ie. Men's Clothing)
The apostrophe is messing everything up.. So I don't have to put a (do not
enter apostrophe's in the box) on the form, what type of error handler can
help me? Thank you in advance!!
Here is the code: (i get the error when an apostrophe is entered into rst1
Do Until rst2.EOF
strSQL = "UPDATE [PARStoreData_tbl] SET [Comments] = """ & rst1.
Fields("Comments").Value & """" & _
" WHERE [PARStoreData_tbl].[QAID] = """ & rst.Fields
("NewQAID").Value & rst2.Fields("Comments").Value & """"
DoCmd.RunSQL strSQL
rst2.MoveNext
Loop