Combining Text and Yes/No In Filter



In a reply on 6-11-2004 On filtering Yes/No fields, Alan Brown
responded with:
Re: Filtering form on True-False check boxes
This example assumes you have *unbound* check boxes on your for
in the form header), and you want to apply a filter based on whicheve
are checked. It visits each one, building up a filter string from th
that are True, and then applies it to the filter of the form:

Dim strFilter As String
Dim lngLen As Long

If Me.chkProblems.Value Then
strFilter = strFilter & "(Problems = True) AND "
End If
If Me.chkInactive.Value Then
strFilter = strFilter & "(Inactive = True) AND "
End If
'etc for other boxes.
lngLen = Len(strFilter) - 5 'Without trailing " AND ".
If lngLen <=0 Then
Me.FilterOn = False
strFilter = Left$(strFilter, lenLen)
Me.Filter = strFilter
Me.FilterOn = True
End If

Could this be adapted to include a wildcard text search along wit
yes/no boxe


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

combining filter fields 9
yes/no box and text box 7
convert yes/no values to text 13
Combine Text Boxes 11
Yes/No Field appears as Text Box 8
Combining Formula and Text question 1
Yes / No 2
yes/no 6