Combo box - need distinct value to appear only

trying

New member
Local time
Today, 05:13
Joined
Aug 15, 2012
Messages
7
I'm building a combo box - when I use the drop down every value in my entire field show up for every record - I only want the distinct values to appear as choices to populate the field.
 
What is your drop down linked to and what do you want it to do when you select something?
 
I'm a beginner so keep that in mind....I have 1 table with 7 fields. I'm trying to do a form with the exact same 7 fields. I want each one of the fields to have a drop down option on the form. There are 1000 records, but within each field there are only about 8 different options. So in the drop down I want to just see the 8 different options per field, rather than see the list of 1000 records.
 
I forgot to mention I just want it to populate the form - then update the table. I'm essentially "entering new records" within the table by using the form.
 
What is the RowSource of the Combo at this moment? can you paste it here??
 
I can't paste it but under "Row/Source Type" it's set to "table/query". This has to be much easier than I realize - if I did this in excel it would just be the filter option.
 
If it is a table/Query then what is the Query?? you can view the query in SQL view and can copy that here..
 
You shouldn't be setting your combo's row source to the table where it will be storing values to. That doesn't really make sense. You should have a table where the values that are available to use are located and with an ID and the combo uses those two fields (ID and description) as the row source. It then stores the ID in the table where you are storing the other 6 fields and does not store the text value of the "lookup value."
 
I'm building a combo box - when I use the drop down every value in my entire field show up for every record - I only want the distinct values to appear as choices to populate the field.
Your RowSource for the ComboBox needs a 'SELECT DISTINCT' statement.
In Form Edit mode, select the ComboBox, select Properties, on the Data tab select RowSource and edit it, which will take you to a Query Builder window. Right click the tab on the Query Builder Window and select SQL VIEW.
Change the first line of the SQL statement from:
SELECT [MyField]
to
SELECT DISTINCT [MyField]

Hope this helps.
 

Users who are viewing this thread

Back
Top Bottom