Filter code not working

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Hi

I am using this code to filter my form:
Dim strr As String
strr = Me.txtSearch

Me.FilterOn = True
Me.Filter = _
"[Library] like '*" & strr & "*'" _
& " or [Instrument] like '*" & strr & "*'" _
& " or [Location] like '*" & strr & "*'" _
& " or [Description] like '*" & strr & "*'" _
& " or [Comment] like '*" & strr & "*'"

The code works for all fields except the location field. All the fields are
text fields.
I tested the filtering of the Location field by entering various simple
words into the Location field for various records and when I type one of the
those words into Me.txtSearch and execute the code, those records are not
returned. All the other fields are working properly with this code.

Can any tell me why the Location field is not included in the filtered
results.


Thanks


.



Relevant Pages

  • Re: Filter code not working
    ... Btw, I typically first set the Filter property, then set FilterOn. ... The code works for all fields except the location field. ...
    (microsoft.public.access.formscoding)
  • Re: Web Wiz Forums ver. 7.01
    ... The values of the variables mentioned by HEX are filtered further on in the code. ... The file register_new_user.asp is not a file that exsits in Web Wiz Forums version 7.01 or above. ... The only variable that was not filtered correctly was the Location field which is populated by a drop down box. ... Form March 2003 the location variable was changed to filter the location field. ...
    (Bugtraq)