Filtering with a Check Box

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!
 
F

fredg

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.
 
T

TheNovice

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.
 

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

Top