Combo Box - no dupilcate values (1 Viewer)

fat controller

Slightly round the bend..
Local time
Today, 17:49
Joined
Apr 14, 2011
Messages
758
I have a combo box which is used to select records that meet a specific criteria - there may be more than one record that matches this criteria, and I want all of those records to be selected. The field that sets the criteria is called BulletinNumber.

This works perfectly well, however the dropdown is showing multiple rows of the same number - so if there are three records that have a BulletinNumber of 850.1, the number 850.1 will appear three times in the drop down list.

I was thinking that using the Min function in the SQL for the combo's query would have made it return each number only once, but that isn't working, hence me seeking your help once again :)

EDIT - Fixed it. I should have put the Min function on the PK field.
 
Last edited:

Minty

AWF VIP
Local time
Today, 17:49
Joined
Jul 26, 2013
Messages
10,372
Try adding SELECT DISTINCT to the combobox query - or use a grouping function to only pull in the top level detail you need.
 

fat controller

Slightly round the bend..
Local time
Today, 17:49
Joined
Apr 14, 2011
Messages
758
I had jumped the gun in saying I had fixed it, because I hadn't. I now have it working, but tried so many different things that I now cannot remember what the SQL was to begin with to compare with the now working SQL to see what I changed to make it work :eek:

Thanks for your help Minty :)
 

Users who are viewing this thread

Top Bottom