MS Access: Display only unique values in a combo box in Access 2003/XP/2000/97
See solution in other versions of Access:
Question: In Microsoft Access 2003/XP/2000/97 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 "Chicago" two times. We want to eliminate any duplicates from being displayed in the combo box. In other words, we only want Chicago 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 from any fields 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)
Then under the View menu, select Properties.
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 Chicago instead of two.