Combo Box Duplicates

  • Thread starter Thread starter bgreer5050
  • Start date Start date
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.
 
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.
 

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

Similar Threads


Back
Top