Combo Box Duplicates

B

bgreer5050

I have a combo box on a form with a row source from a query. The
combo box (cboYear) is to bring up a list of years from cars for an
auto parts appication. The query where the years come from have
multiple records with the same year, yet I want the combo box to list
the year only once.

How can I get this done? Thanks.
 
6

'69 Camaro

Hi.
The query where the years come from have
multiple records with the same year, yet I want the combo box to list
the year only once.

The SELECT clause must use the word DISTINCT, or else the GROUP BY clause
must be added to the query used in the combo box's Row Source Property. For
example:

SELECT DISTINCT ModelYear
FROM Autos
ORDER BY ModelYear;

Or:

SELECT ModelYear
FROM Autos
GROUP BY ModelYear;

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.
Blog: http://DataDevilDog.BlogSpot.com
http://www.Access.QBuilt.com/html/expert_contributors2.html for contact
info.
 
Top