MS Access 2007: Display only unique values in a combo box
This MSAccess tutorial explains how to display only unique values in a combo box in Access 2007 (with screenshots and step-by-step instructions).
See solution in other versions of Access:
Question: In Microsoft Access 2007 when I try to build a combo box in an Access form, I get several repetitions of the same city displaying in the combo box. How can I design the combo box so that only unique cities appear?
Answer:Let's look at an example.
In this example, we have a combo box that is displaying the value "Buenos Aires" three times. We want to eliminate any duplicates from being displayed in the combo box. In other words, we only want Buenos Aires to appear once.
To do this, open the Form in Design view. Then right-click on the combo box and select Properties from the popup menu.
Then click on the button (with the 3 dots) to the right of the "Row Source" property to bring up the Query Builder window.
In the Query Builder window, position the mouse pointer over an area to the right of the table and click on the left mouse button. This will switch the focus to the main query. (so that when you view the Properties window, it displays the properties for the query and not one of the fields)
When the Query Properties window appears, set the Unique Values property to "Yes".
Next, close the query builder window by clicking on the X in the top right corner of the Query Builder window.
You will be prompted to save the changes. Click on the "Yes" button.
Now when you view the values in the combo box, you will see that only unique values appear. In this example, there is only one occurrence of Buenos Aires instead of three.
Advertisements