Hi everyone!
I've got the following code in part of my form:
If Not IsNull(Me("txtVal" & i)) Then
strWhere = strWhere & strJoinType & Application.BuildCriteria( _ "[" & Me("cbxFld" & i) & "]", _ fld.Type, Me("txtVal" & i) & ""
Else
strWhere = strWhere & strJoinType & "[" & Me("cbxFld" & i) & "] like '*'"
End If
End If
Next
'The final important SQL statement
strSQL = strSQL & " from [" & Me.lstTables & "] Where " & strWhere
At the moment, when I type in a search criteria in the txtVal0 box, then it searches for the exact match.
What I need to do is search for a match that is LIKE search criteria entered by the user (eg. find all records beginning with "abc" when "abc" is typed in the text box).
I've tried inserting a "LIKE" in the SQL statement but I think I may have something missing.
If anyone could help me with this, it'd be much appreciated...
Thanks,
Dan.
I've got the following code in part of my form:
If Not IsNull(Me("txtVal" & i)) Then
strWhere = strWhere & strJoinType & Application.BuildCriteria( _ "[" & Me("cbxFld" & i) & "]", _ fld.Type, Me("txtVal" & i) & ""
Else
strWhere = strWhere & strJoinType & "[" & Me("cbxFld" & i) & "] like '*'"
End If
End If
Next
'The final important SQL statement
strSQL = strSQL & " from [" & Me.lstTables & "] Where " & strWhere
At the moment, when I type in a search criteria in the txtVal0 box, then it searches for the exact match.
What I need to do is search for a match that is LIKE search criteria entered by the user (eg. find all records beginning with "abc" when "abc" is typed in the text box).
I've tried inserting a "LIKE" in the SQL statement but I think I may have something missing.
If anyone could help me with this, it'd be much appreciated...
Thanks,
Dan.