H
Hugh McK
Used LIST BOX to search a table of surnames to find a record. Works as
expected until you have a surname which includes an apostrophe, eg O'Dwyer
when you get runtime error 3077 syntex error (missing operator) in
expression. Code was generated by the Wizard.
Private Sub List40_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[SURNAME] = '" & Me![List40] & "'"
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub
Obviously line rs.FindFirst needs to be amended, but how?
Work around is not to include apostrophe in peoples' name, but that may
offend some.
expected until you have a surname which includes an apostrophe, eg O'Dwyer
when you get runtime error 3077 syntex error (missing operator) in
expression. Code was generated by the Wizard.
Private Sub List40_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[SURNAME] = '" & Me![List40] & "'"
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub
Obviously line rs.FindFirst needs to be amended, but how?
Work around is not to include apostrophe in peoples' name, but that may
offend some.