Filtering Forms

andrew46

New Member
Joined
Jul 14, 2004
Messages
9
Hello,

I am pretty new to access and don't really know much about it. I just made up a basic table and form. I want to be able to filter the form so once I mark a field which has a checkbox, that form disappears, and only the forms that are not checked are left. Does anyone know how to do this? I know there is a way as I have seen it working in a database but I just don't know how to do it myself!

Cheers

Andrew
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
You will need to use a query for the form, then in the field that you have the check box set the criteria to False.

You may alos want to add a requery to the field in the form to autoaticaly hide the record.

in the AfterUpdate event for the field add Me.requery

HTh

Peter
 
Upvote 0
Thanks!

The first bit helped heaps. I don't quite understand the 2nd bit though. What is the after update event bit????
 
Upvote 0
In design mode of the Form got to the properties for your control and there is one under events called "After Update", this runs the code whenever the value of that field changes.
If you hit the build button and select code, the code pane will open up ready for code, just add the line above and you should end up with something like
Code:
Private Sub MyField_AfterUpdate()
      Me.requery 
End Sub

This will cause Access to requry the form if you click the check box and hide the record that you have just selected.
Whether you will actualy need this depends on what you are doing.

Just try it and see :)

Peter
 
Upvote 0

Forum statistics

Threads
1,221,813
Messages
6,162,117
Members
451,743
Latest member
matt3388

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top