ComboBox (stopping dual values)(newbie how to)

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to create a combobox for an order form. Each order is a new
record. I want the combobox to be for what city the order should be sent to.
But i dont want to have to type in the same city over and over again, so i
have it that the source for the combobox is the same as the
controlscource/place where the record is stored.
Using:
Row Source: SELECT DISTINCT [city] FROM [orders] ORDER BY [city];
Limit To List: No

But as of now if i have more then one order entered to the same city it will
list both of them on the list. So i want to limit the list to only one copy
and if possible it sort the list in alphabetical order and not the order of
the record number.
Thank You
 
Create a query with only City as field and then "group"
them, by using the build icon on the toolbar

Than use that query for your combo box
 
Thats wierd! DISTINCT should eliminate duplicates in this case. I can't
think what could be going wrong, but humour me, try this:

SELECT DISTINCT city FROM orders ORDER BY city

It's the same as what you had, but without the square brackets.

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia

Microsoft Access 2003 VBA Programmer's Reference
http://www.wiley.com/WileyCDA/WileyTitle/productCd-0764559036.html
 
Back
Top