Filtering with a Check Box

  • Thread starter Thread starter TheNovice
  • Start date Start date
T

TheNovice

OK,

I know that this one is soooo easy, I hope you all don't think I am a DUFUS.

Here I go!

I have a form and what i would like to do is Filter it based and the content
(or lack thereof) in a field.

the field is mtDateReturned, i would like it to initially show all of the
records and once the user checks the check box, it will filter out all of the
records that have a Null in the mtDateReturned field. this way they can just
review the pending records and not having to go through the whole list of
records.

as always,

Thanks!
 
OK,

I know that this one is soooo easy, I hope you all don't think I am a DUFUS.

Here I go!

I have a form and what i would like to do is Filter it based and the content
(or lack thereof) in a field.

the field is mtDateReturned, i would like it to initially show all of the
records and once the user checks the check box, it will filter out all of the
records that have a Null in the mtDateReturned field. this way they can just
review the pending records and not having to go through the whole list of
records.

as always,

Thanks!

Add that check box to the form header (or Footer), not the Detail
section.
Code it's AfterUpdate event:
If Me![CheckBoxName] = -1 then
Me.Filter = "[mtDateReturned] Is Null"
Me.FilterOn = True
Else
Me.FilterOn = False
End If

Checking or unchecking the Check Box will toggle the filter.
 
As I said, very simple.

Thanks a million
--
-The Novice
Learn Today, Teach Tomorrow

Great Success is ones ability to ask for Help.


fredg said:
OK,

I know that this one is soooo easy, I hope you all don't think I am a DUFUS.

Here I go!

I have a form and what i would like to do is Filter it based and the content
(or lack thereof) in a field.

the field is mtDateReturned, i would like it to initially show all of the
records and once the user checks the check box, it will filter out all of the
records that have a Null in the mtDateReturned field. this way they can just
review the pending records and not having to go through the whole list of
records.

as always,

Thanks!

Add that check box to the form header (or Footer), not the Detail
section.
Code it's AfterUpdate event:
If Me![CheckBoxName] = -1 then
Me.Filter = "[mtDateReturned] Is Null"
Me.FilterOn = True
Else
Me.FilterOn = False
End If

Checking or unchecking the Check Box will toggle the filter.
 
Back
Top