I have a table with a text field that has data imported into from an outside source (XLS spreadsheet). I then have a function that loops through this table and searches for occurences of certain text strings. The problem I am having is that sometimes the text strings being searched have quotes in them:
i.e. - 17" rope cord
and sometimes the text strings have single quotes in them
i.e. I's rope cord's
I previously had this code:
'Me.strVDestColumn is the column name being searched
'rsProducts(strVSourceColumn) is the text string the recordset is looking for
strCriteria = "[" & Me.strVDestColumn & "] = '" & rsProducts(strVSourceColumn) & "'"
'Filtering main product recordset for potential matching data
This code works fine with the double quotes, but fails on single quotes.
How do I universally filter/search for text strings that may have single quotes, may have double quotes, or may have neither?