Combo Box with only unique values

gheyman

Well-known Member
Joined
Nov 14, 2005
Messages
1,875
Office Version
  1. 365
Platform
  1. Windows
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
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.

Joe4

MrExcel MVP, Junior Admin
Joined
Aug 1, 2002
Messages
59,101
Office Version
  1. 365
Platform
  1. 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:

Forum statistics

Threads
1,141,818
Messages
5,708,763
Members
421,588
Latest member
Wawie

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top