Link to home
Start Free TrialLog in
Avatar of Melissa-FAC
Melissa-FACFlag for United States of America

asked on

Access Filter a List Box so no duplicates

I have a query that I am running based on one of the fields in the table.  I don't want to rely on users to enter the date in the correct format so I have it set to create a list box with the values found in the field but since it is a date field, I have many duplicates.  How can I filter the list box values so that each value is only listed one time?

i.e.  Field contains 26-May-09, 26-May-09, 26-May-09, 25-May-09, 25-May-09, 24-May-09

List box would contain:
26-May-09
25-May-09
24-May-09

Thank you.
ASKER CERTIFIED SOLUTION
Avatar of Patrick Matthews
Patrick Matthews
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Melissa-FAC

ASKER

Seems simple enough but.... I have an issue with my field that am trying to search.  When I create the listbox, I select the table and then that one field.  When I advance to the next screen that allows me to set the sort order for the field, it has also pulled the PK into the query.  If I remove the PK from the query, I do not get any results.  If I leave it in, I still have all of the date results (I am guessing because the primary key is distinct).

I am trying to fix a db someone else started.  Is there a way to separate the date field from the PK?

Thanks.
It worked perfectly.  I just had to change the source of my form.  Thank you!