I have a form that displays contacts. Name, address, etc. On the form is a combo box that is used to find a contact. The following code is used on the after update event on the combo box:
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[Surname] = '" & Me![Find_Surname] & "'"
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
This works perfectly except for names like O'Brien. What do I need to do to make the query work with apostrophes?
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[Surname] = '" & Me![Find_Surname] & "'"
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
This works perfectly except for names like O'Brien. What do I need to do to make the query work with apostrophes?