The only problem with using the Replace function is that wherever there is ", it is replaced by" ", even if you have already qualified a single quote with another separate quote after it:" "" becomes "" '' '( and so on).
You can create a procedure or function to check the strings "[!" ] and replace those used with Like:
Public function QualifySingleQuote (myStr as string) As String
If myStr Like "*'[!']*" Then QualifySingleQuote = Replace(myStr, "'", "''") Else QualifySingleQuote = myStr EndIf
Final function
source share