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).
John W. Vinson - 31 May 2007 04:52 GMT
>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]