Combo Box with only unique values

gheyman

Well-known Member
Joined
Nov 14, 2005
Messages
1,730
I have a combo box on a form. It is based off a query

SELECT [qry_vluVendorAddress].[VendorName], [qry_vluVendorAddress].[VendorID], [qry_vluVendorAddress].[CityName], [qry_vluVendorAddress].[MailState], [qry_vluVendorAddress].[CountryCode] FROM qry_vluVendorAddress ORDER BY [VendorName];

How do I get the Combo Box to not show Duplicates?

Not the query I listed above was created just for the Combo box list (based on two tables). So I can do what ever is needed to get a list that only has unique records

Thanks
 

Some videos you may like

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.

Joe4

MrExcel MVP, Junior Admin
Joined
Aug 1, 2002
Messages
53,442
Office Version
365
Platform
Windows
Re: Access: Combo Box with only unique values

One way is to group the records via an Aggregate Query.
You do this by grouping by all the fields in your Select clausei.e.
Code:
[COLOR=#333333]SELECT [qry_vluVendorAddress].[VendorName], [qry_vluVendorAddress].[VendorID], [qry_vluVendorAddress].[CityName], [qry_vluVendorAddress].[MailState], [qry_vluVendorAddress].[CountryCode] 
FROM qry_vluVendorAddress 
[/COLOR][COLOR=#ff0000]GROUP BY [qry_vluVendorAddress].[VendorName], [qry_vluVendorAddress].[VendorID], [qry_vluVendorAddress].[CityName], [qry_vluVendorAddress].[MailState], [qry_vluVendorAddress].[CountryCode] [/COLOR][COLOR=#333333]
ORDER BY [VendorName];[/COLOR]
Another alternative can be found here: https://support.office.com/en-us/ar...edicates-24f2a47d-a803-4c7c-8e81-756fe298ce57
 
Last edited:

Watch MrExcel Video

Forum statistics

Threads
1,099,503
Messages
5,468,998
Members
406,627
Latest member
IncandenzaH1997

This Week's Hot Topics

Top