Hi all,
Hope this thread is posted in the right place....
Just wanted a bit of help with some Access VBA; I've got a table I'm trying to update via an unbound form.
My code falls over when trying to update a record for a person with a ' in their name i.e. O'Neil, O'Mara etc.
Does anyone know the syntax for updating a table in Access VBA where a field contains a '?
Many thanks!
Hope this thread is posted in the right place....

Just wanted a bit of help with some Access VBA; I've got a table I'm trying to update via an unbound form.
My code falls over when trying to update a record for a person with a ' in their name i.e. O'Neil, O'Mara etc.
Does anyone know the syntax for updating a table in Access VBA where a field contains a '?
Code:
strSQL = "UPDATE tbl_Death SET Death_Name = '" & Me.txtName & "' WHERE tbl_Death.Death_ID = " & Me.txtDeathID & ""
DoCmd.SetWarnings False
DoCmd.RunSQL (strSQL)
DoCmd.SetWarnings True
Many thanks!