3077 error remedied, does not work with index, yes no duplicates
I have created a search field on a form that refers to a query. It searches by Organization Name. Some organizations have an apostrophe in the name, and that caused an error No. 3077. This was remedied with the following code:
Code:
Public Function fHandleApostrophe(strPass As String) As String
Dim strRet As String
strRet = strPass
If InStr(1, strRet, "'", vbTextCompare) > 0 Then
Last edited by TheSmileyCoder; Nov 23 '11, 08:57 PM.
Reason: Added [Code] at the beginning of your code and [/Code] at the end of your code. Please remember to do this in the future.