View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
willwonka[_4_] willwonka[_4_] is offline
external usenet poster
 
Posts: 10
Default Wildcard Filtering on ADO Recordset

So, in my case the mappings with question marks all started with 8 so I just had to build in some logic and do some combo filtering. Kind of a pain and probably not the most effecient but it worked.

Here is what I did.

Was:
lsfilter = "JDEAcct like '" & lsSymbol & "'"
mrsData.Filter = lsfilter

Changed to:

If Left(lsSymbol, 1) = "8" Then
If Right(lsSymbol, 1) = "*" Then
lsfilter = "JDEAcct like '*" & Mid(lsSymbol, 4, Len(lsSymbol) - 3) & "' AND JDEACCT like '8*'"
Else
lsfilter = "JDEAcct like '*" & Mid(lsSymbol, 4, Len(lsSymbol) - 3) & "*' AND JDEACCT like '8*'"
End If
Else
lsfilter = "JDEAcct like '" & lsSymbol & "'"
End If


mrsData.Filter = lsfilter