*
yourtrashhere@gmail.com:[color=blue]
> So basically, what I have is a bunch of words in one memo field, for
> example:
>
> dog cat cowboy tree flower
>
> To search it, this is the code I have now.
>
> ' Check for LIKE Last Name
> If Me.txtLastName > "" Then
> varWhere = varWhere & "[LastName] LIKE """ & Me.txtLastName & "*" * "
> AND "
> End If
>
> The only problem is what I search for needs to be "in order", for
> example, if I search for dog, I'll get the table. But, if I seach for
> tree, I won't because tree was not place first. Can you please help me?
> Thanks a lot!
> Reply With Quote
>[/color]
You haven't provided much information so I suspect this is going to get
you some results that you don't want. But, it should get "tree".
' Check for LIKE Last Name
If Me.txtLastName > "" Then
varWhere = varWhere & "[LastName] LIKE ""*" & Me.txtLastName & "*"" "
End If
If you had both boy and cowboy in the field and you search for boy,
you'd get both. This might do better.
' Check for LIKE Last Name
If Me.txtLastName > "" Then
varWhere = varWhere & "[LastName] LIKE """ & Me.txtLastName & _
" *"" OR [LastName] LIKE ""* " & Me.txtLastName & "*"""
End If
--
Randy Harris
tech at promail dot com
I'm pretty sure I know everything that I can remember.