I have a chunk of code that needs to be able to handle a variety of text strings. The code below is part of a larger UPDATE statement...
"icd_desc = " & IIf(IsNull(rec!icd_desc), "NULL", """" & TStr(rec!icd_desc) & """") & ", "
In the situation that's causing my error, this is the value of rec!icd_desc:
With the code above, I end up with this:
How do I get the quotes right in this situation? The code needs to handle a text string in rec!icd_desc with no quotes, double quotes, or single quotes. We might get values of rec!icd_desc with no quotes:
or with a single quote, like this: