Like and Search String

L

Lin

Hi All thanks in advance.
Highlight:: Using an unbound list box and unbound text on form. Coding for
search in text box as follows:

Dim txtSearchString As Variant
Dim strSQL As string

txtSearchString = Me![txtFirstName].Text

strSQL = "SELECT DISTINCTROW tblpeople.peopleID, tblPeople.FirstName FROM
tblPeople"
strSQL = strSQL & "WHERE ((tblPeople.FirstName) Like '" & txtSearchString &
"*')"

etc... It all works well enough, as I type into text box the results start
to appear.
My Question then is this, assume I have a pereson with first names (Margaret
Jean)
If I type Jean I do not see it. If I type *Jean I see all marg...Jean...
How can I incorporate this into the Like statement with the wildcard.
Notice I have
an astrick already. Any help would be greatly appreciated.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top