Hello
I have a problem with a listbox showing duplicate records when I want it to ignore them and just show ONE instance of the record.
Allow me to explain.
I have a listbox based on a query that displays a list of items dependent on what a user selects in a combo box on the same form.
For example:
In the combo box the user selects "Apples" and in the list box all the different type of apples is displayed like so:
fldFruit fldType
-------- -------
Apples Eating
Apples Desert
Apples Cooking
In the table that the query gets the details from, there are duplicate entrys as the table also lists the different suppliers of apples and you can get the same type of apple from different suppliers.
My problem is that the list box shows all the entrys in that table for the item selected in the combo box and I only want ONE instance of each apple type.
For example:
List box currently shows:
fldSupplier fldFruit fldType
----------- -------- -------
Hallam & son Apples Eating
Hallam & son Apples Desert
Gregsons Apples Cooking
Gregsons Apples Eating
Gregsons Apples Desert
What I want it to show is:
Hallam & son Apples Eating
Hallam & son Apples Desert
Gregsons Apples Cooking
The important field for me in the listbox is fldType in as much as, that is where the duplicate data is. I have tried using SELECT and SELECT DISTINCT and SELECT DISTINCTROW both in the query's SQL and the combo boxes SQL but with no luck.
Can someone kindly help me ou and tell me what I am doing wrong please.
Thank you in advance.
I have a problem with a listbox showing duplicate records when I want it to ignore them and just show ONE instance of the record.
Allow me to explain.
I have a listbox based on a query that displays a list of items dependent on what a user selects in a combo box on the same form.
For example:
In the combo box the user selects "Apples" and in the list box all the different type of apples is displayed like so:
fldFruit fldType
-------- -------
Apples Eating
Apples Desert
Apples Cooking
In the table that the query gets the details from, there are duplicate entrys as the table also lists the different suppliers of apples and you can get the same type of apple from different suppliers.
My problem is that the list box shows all the entrys in that table for the item selected in the combo box and I only want ONE instance of each apple type.
For example:
List box currently shows:
fldSupplier fldFruit fldType
----------- -------- -------
Hallam & son Apples Eating
Hallam & son Apples Desert
Gregsons Apples Cooking
Gregsons Apples Eating
Gregsons Apples Desert
What I want it to show is:
Hallam & son Apples Eating
Hallam & son Apples Desert
Gregsons Apples Cooking
The important field for me in the listbox is fldType in as much as, that is where the duplicate data is. I have tried using SELECT and SELECT DISTINCT and SELECT DISTINCTROW both in the query's SQL and the combo boxes SQL but with no luck.
Can someone kindly help me ou and tell me what I am doing wrong please.
Thank you in advance.