'Search an MS Access form for a record based on partial text

When creating a combo box with the form wizard, you can make it select a form record based on the combo box selection. I want to do a similar thing from a text box, but I want it to search for a partial string. I adjusted the form wizard code like this:

Private Sub txtSearchString_AfterUpdate()
    ' Find the record that matches the control.
    Dim rs As Object
    Set rs = Me.Recordset.Clone
    rs.FindFirst "[RequestName] LIKE *" & Str(Nz(Me![txtSearchString], 0)) & "*"
    If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub

I get a "Type mismatch" error. Is there something wrong with my code or is this something the FindFirst function isn't capable of?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source