Need help with VB search "Like" code

pikoy

Registered User.
Local time
Today, 11:21
Joined
Dec 23, 2009
Messages
65
Trying to create a code that will search a word contained in a field...

see code below: What am I missing? It returns blank.

Code:
         ' If Name
    If Nz(Me.Mname) <> "" Then
        'Add it to the predicate - exact match
        strWhere = strWhere & " AND " & "USERS.USER_NAME LIKE ' * " & Me.Mname & " * '"
    End If
 
Too many spaces around the * I think.
Try
Code:
 ' If Name
    If Nz(Me.Mname) <> "" Then
        'Add it to the predicate - exact match
        strWhere = strWhere & " AND USERS.USER_NAME LIKE '*" & Me.Mname & "*'"
    End If
[/QUOTE]
 
you are awesome!!! that fixed the issue....
 
Glad to help. Could you flag the thread as 'solved', in case anyone else is looking for the same thing.
 

Users who are viewing this thread

Back
Top Bottom