Hi everyone, I'm having the devil of a time remembering the proper code to create a search textbox on my form that can be used to make "inexact" matches.
Here's the setup:
I have a form based on a table called Books with a couple of fields I want to search on: Title and AuthorLN.
Want to be able to type "power" and come up with the following books:
Power Broker
The Power of the Kabbalah
or type "frank" and come up with:
The Diary of a Young Girl (by Anne Frank)
Anne Frank in Holland
(all articles are in a separate field)
I need to be able to make approximate matches on either field --Title, AuthorLN.
I have researched other threads on this in the forum and can't find exactly what I want.
I started with just the Title field to play around with and have been trying to adapt this code I found on an old thread:
Code:
Private Sub FindABook_AfterUpdate()
With Me.RecordsetClone
Me.RecordsetClone.FindFirst "Title Like " & Chr(34) & "*" & Me.FindABook & Chr(34)
If .NoMatch Then
MsgBox "You must have dreamed that book up, cuz it ain't here!", vbExclamation, "REALLY?"
Else
Me.Bookmark = .Bookmark
End If
End With
End Sub
Doesn't quite do what I want and seems to work only after one try (matching up to beginning characters)
Am using Access 2010.
And help you can give me will be GREATLY appreciated!
Thanks,
Lakotaman