I have this piece of VB quoting a piece of SQL for the criterion:
If DCount(“[ClientID]”, “tblNarrative”, _
“[ClientID]=” & ClientID _
& ” and [NarrativeText]='” & NarrativeText & “‘” _
) > 0 _
Then
There will be a syntax error whenever my NarrativeText contains an apostrophe, and I cannot control what is in or already found in the database. My NarrativeText is a parameter of my function, called in SQL in INSERT. I do have a function WithoutApostrophe, and I can put it around the database and local NarrativeText, but there ought to be a better way of quoting a variable which may contain an apostrophe. Does anyone know one?