I Need to eliminate repeat entries of Names in a Combo pull down list
I have since found out that this is possible with the DISTINCT directive in a simple query like
SELECT DISTINCT [Name] FROM Miracle_Cloth_Main ORDER BY [Name] DESC; as the source
property of the combo box.
It looks like ACCESS needs A primary Key included in the querry for the source property
of the combo for the FindFirst function in the after_update event of the combobox
to work with a code similar to
rs.FindFirst "[RecordNum] = " & Str(Nz(Me![Combo112], 0))
The Wizard generate the following code even if you don't select the Primary Key(RecordNum)
during the creation process.
SELECT Miracle_Cloth_Main.RecordNum, Miracle_Cloth_Main.Name, Miracle_Cloth_Main.Cust_ID FROM Miracle_Cloth_Main ORDER BY [Cust_ID] DESC;
Even if you add the DISTINCT Cluse to the above code
it doesn't filter the repeat data.
Is there a compromise where I can get the Filtering by DISTINCT clause to work with the code generated by the wizard so that I get the FindFirst function as well to work ?
I have since found out that this is possible with the DISTINCT directive in a simple query like
SELECT DISTINCT [Name] FROM Miracle_Cloth_Main ORDER BY [Name] DESC; as the source
property of the combo box.
It looks like ACCESS needs A primary Key included in the querry for the source property
of the combo for the FindFirst function in the after_update event of the combobox
to work with a code similar to
rs.FindFirst "[RecordNum] = " & Str(Nz(Me![Combo112], 0))
The Wizard generate the following code even if you don't select the Primary Key(RecordNum)
during the creation process.
SELECT Miracle_Cloth_Main.RecordNum, Miracle_Cloth_Main.Name, Miracle_Cloth_Main.Cust_ID FROM Miracle_Cloth_Main ORDER BY [Cust_ID] DESC;
Even if you add the DISTINCT Cluse to the above code
it doesn't filter the repeat data.
Is there a compromise where I can get the Filtering by DISTINCT clause to work with the code generated by the wizard so that I get the FindFirst function as well to work ?
Last edited: