Expand|Select|Wrap|Line Numbers
- Public Function fHandleApostrophe(strPass As String) As String
- Dim strRet As String
- strRet = strPass
- If InStr(1, strRet, "'", vbTextCompare) > 0 Then
- strRet = "'" & Replace(strRet, "'", "''", , , vbTextCompare) & "'"
- Else
- strRet = "'" & strRet & "'"
- End If
- fHandleApostrophe = strRet
- End Function
Expand|Select|Wrap|Line Numbers
- Sub cmbOrgName_AfterUpdate()
- ' Find the record that matches the control.
- Me.RecordsetClone.FindFirst "[OrganizationName]= " & fHandleApostrophe(Me![cmbOrgName])
- Me.Bookmark = Me.RecordsetClone.Bookmark
- End Sub
My problem is that I then changed gave that field an index of "Yes (No Duplicates)". After I did that, my search still works, UNLESS I SELECT AN ORGANIZATION WITH AN APOSTROPHE in the name. It works if it is not indexed, but not if it is indexed. I need the field to be indexed, no duplicates, but also need the search field to work. Any suggestions?