How do I Show and Hide Records on an AccessForm?
Posted on 2013-10-31
I would like to place a button or a checkbox in the header of an Access 2010 form that allows me to toggle between showing all records and showing only the “active” records. The records are displayed in datasheet view.
The name of the form is CONTACT LIST. The record source of the form is a query called CONTACTS EXTENDED.
I have a Yes/No field in the source table named HIDECONTACT which I will check when I want to mark a record as “inactive”. I set the toggle button to this field as the record source.
How do I set the button and the form so that:
1) On click, the form toggles between all records and only records where HIDECONTACT is null or false (not selected).
2) Only active records are displayed when the form opens?
I tried it a dozen ways and I am confused how the filter settings in the button properties work in tandem with the VBA. Any explanation here would be helpful.
I’m a rookie. Thanks in advance for your help, experts!