davidd31415
Programmer
I am creating records using SQL as follows:
If textString contains an apostrophe the SQL statement is corrupted. How do I stop this from happening while allowing apostrophes to be stored in TextField?
Thanks,
David
Code:
Dim DB as DAO.Database
Set DB = CurrentDb
strSQL = "INSERT INTO Transactions (TextField) VALUES ('" & textString & "')"
DB.Execute (strSQL)
DB.Close
Set DB = Nothing
If textString contains an apostrophe the SQL statement is corrupted. How do I stop this from happening while allowing apostrophes to be stored in TextField?
Thanks,
David