Multiple filters

G

Guest

I have a form in which I filter groups of employees based on the lat name
using alpha filters (command buttons). I will like to add a filter that can
filter these emplyees based on their title, using a command button and be
able to re-filter the records based on the last name using the alpha filter.

The problem I have experinced is that after filtering the employees by
title, pressing the alpha button clears the first filter. At the time I have
created a query for each title and am looking into reducing th number of
queries that I have.

The database runs on ACcess 2003 at work but I use 2007 at home (if it makes
adifference).
 
J

John W. Vinson

The problem I have experinced is that after filtering the employees by
title, pressing the alpha button clears the first filter. At the time I have
created a query for each title and am looking into reducing th number of
queries that I have.

I'd use a Parameter Query rather than having a separate query for each
position. You could have a Combo Box on the form selecting all of the valid
titles, and include a clause

[Title] = [Forms]![YourFormName]![TitleComboBoxName]

in the filter. Note that a Filter string is essentially a SQL Query WHERE
clause without the word WHERE, so it can include multiple different fields and
different criteria. What you want is a Filter string resembling

[LastName] LIKE "A*" AND [Title] = [Forms]![YourFormName]![TitleComboBoxName]

or however you're managing the alpha search.

John W. Vinson [MVP]
 

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