limit combo box

A

Antonio

I am using a combo box to locate records on the curren
form based on a "DateOfVisit" field. Right now, there are
100 records in this table (we add about 50 a day). 50
records have a Date of Visit of 2/14/2004 and the other
50 records have a Date of Visit of 2/15/2004. If you
click on the drop down of the combo box, it displays the
date 2/14/2004 50 times, and then 2/15/2004 50 times,
once for each record. Is there a way to have the combo
box display the various dates only once...so that when
you click on the date it takes you to the first record
that contains that Date Of Visit the user specified (they
are listed in decending order)... instead of 50 2/14/04,
and 2/15/04's, and more dates as records are created (the
records are imported in batches based on date of visit),
there combo box drop down would list the dates once as:
2/17/04, 2/16/04, 2/15/04, 2/14/04, etc...
TIA
 
A

Allen Browne

Create a query as the source for the combo.

In query design view, open the Properties box (View menu).
Set the Unique Values property to Yes.

Beside the scenes, Access adds DISTINCT to the query, i.e.:
SELECT DISTINCT ...
 
J

John Vinson

Is there a way to have the combo
box display the various dates only once

Yes; base the Combo Box on a Query selecting just the date field, with
the Query's Unique Values property set to Yes.
 

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