screening values

  • Thread starter Thread starter Delf
  • Start date Start date
D

Delf

I have a subform on a form that shows the list of related
staff members for a specific department. Now some of the
employees don't work there anymore but the company wishes
to keep them in their database. However when we look at
the department we don't want to show the employees who are
gone. I have included a tick box to use when employees are
no longer with the company. what is the code to insert on
the department forms so it doesn't show those people??
Tx
 
If you never want to see these people, create a query and use it as the
RecordSource for your form, e.g.:
SELECT * FROM tblEmployee WHERE Inactive =False;

If you want the user to be able to see them if they wish, set the form's
Filter = "Inactive = False", remembering to set FilterOn = True as well.

The examples assume that the yes/no field is named Inactive.

BTW, if you have many thousands of employees, open your table in design view
and set the Indexed property for the yes/no field to:
Yes (Duplicates Ok)
Although conventional wisdom says not to index a field where there are only
a couple of possible values, this really does make a performance difference
in Access where you are constantly wanting to select based on this field.
 
Back
Top