I have an access database that on my interface I use a combo box to allow a user to scroll to the record he or she desires and when clicked it populates the appropriate fields on the form.
Everything works just fine except when the name highlighted in the combo box has an apostraphie (') such as: O'Brien.
When I do select a name such as O'Brien VB errors out to this subprocedure in my code, giving me a syntax error-- '3077' missing opperator in expression-- Here is my code.
Could anyone please tell me how to get around the issue of apostraphies in combo boxes.
code:
Private Sub Combo22_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[PATIENT] = '" & Me![Combo22] & "'"
Me.Bookmark = rs.Bookmark
End Sub
Thanks,
Mike
Everything works just fine except when the name highlighted in the combo box has an apostraphie (') such as: O'Brien.
When I do select a name such as O'Brien VB errors out to this subprocedure in my code, giving me a syntax error-- '3077' missing opperator in expression-- Here is my code.
Could anyone please tell me how to get around the issue of apostraphies in combo boxes.
code:
Private Sub Combo22_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[PATIENT] = '" & Me![Combo22] & "'"
Me.Bookmark = rs.Bookmark
End Sub
Thanks,
Mike