apply filter on form open

G

Guest

I am wondering what the best way of applying a filter on a form open would
be. I have an employee database where the main employee info is kept under
tblEmployees. All the employees basic info is here as well as the
active/inactive status, whether or not they are still employed. Other tables
are in the database also, such as trainings, wage, etc., and they all are
accessed by forms and a subform since the primary key is the employee ID.
The majority of all my forms are a form/subform, with the form being the
employee ID, and name, and the subform being the information on the related
tables such as trainings.

I have filtered all my drop down boxes to exclude anyone marked as
separated, but noticed when opening a form to enter a training that an
ex-employee with the last name Adkins, is the first name in are employees but
is no longer here. So whenever we open a form to enter stuff, it always
opens to her record. I set a filter on and if you apply it, it will go to
the first active employee, but once the form is closed, it disregards the
filter and you have to reapply it. Anyway to automate this since it is in a
form/subform setting?
 
J

John Vinson

I am wondering what the best way of applying a filter on a form open would
be.

If you're basing the Form on a Table, consider changing it so that it
is instead based on a Query with criteria selecting only the records
you want shown.


John W. Vinson[MVP]
 
G

Guest

I use the forms for data entry only, I have reports that pull off of queries
for others to look at. When someone would go to enter data under the
frmTrainings, when they open it they are going to have the record of a past
employee in front of them, which would through some people off. I would like
just to be able to reduce the step of having them hit the apply filter button
every time they open a form.
 
J

John Vinson

I use the forms for data entry only, I have reports that pull off of queries
for others to look at. When someone would go to enter data under the
frmTrainings, when they open it they are going to have the record of a past
employee in front of them, which would through some people off. I would like
just to be able to reduce the step of having them hit the apply filter button
every time they open a form.

What I'm suggesting is that frmTrainings ITSELF should be based on a
Query selection only current employees. It should not be bound
directly to the Employee table. There is no reason why the user should
need to apply the filter!


John W. Vinson[MVP]
 
G

Guest

I'm sorry this is taking me a while to gather....that time of year. So
you're saying create a query that pulls only current employees, base my form
off of that, then I can create the subform to pull in the training info in
for those current employees?
Thanks
 
J

John Vinson

I'm sorry this is taking me a while to gather....that time of year. So
you're saying create a query that pulls only current employees, base my form
off of that, then I can create the subform to pull in the training info in
for those current employees?
Thanks

Yes, exactly.

John W. Vinson[MVP]
 
G

Guest

That worked great. Thanks. Not sure why I never thought of that, just get
in a certain mind set I guess.
 

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