Re: Filter code not working
- From: Tom van Stiphout <tom7744.no.spam@xxxxxxx>
- Date: Wed, 22 Jul 2009 07:30:47 -0700
On Wed, 22 Jul 2009 01:26:01 -0700, DZ <DZ@xxxxxxxxxxxxxxxxxxxxxxxxx>
wrote:
Btw, I typically first set the Filter property, then set FilterOn.
Perhaps because there is no Location field? Note that a filter
expression must use Field names, not Control names.
-Tom.
Microsoft Access MVP
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
- References:
- Filter code not working
- From: DZ
- Filter code not working
- Prev by Date: Re: setting and clearing record dirty (A 2007)
- Next by Date: Re: Print multiple reports from Command Button with Filter
- Previous by thread: Filter code not working
- Next by thread: Re: Filter code not working
- Index(es):
Relevant Pages
|