zibzaba
05-30-2010, 05:31 AM
hi,
i need help in Adding an ALL Choice to a Combo Box (http://www.databaselessons.com/adding-an-all-choice-to-a-combobox.php) in my report in attatched db. how can i add ALL to the list in customer name in the form "Customer Orders by customer repot" !!!!!!!!!!!!
thanx:rolleyes:
highandwild
05-30-2010, 07:37 AM
Try this, it worked for me.
SELECT DISTINCTROW Customers.Customer_ID, Customers.Customer_Name FROM Customers UNION SELECT ALL 0 as Customer_ID, "All Customers" as Customer_Name FROM Customers
ORDER BY Customer_Name;
Remember that you cannot edit it in design view, only SQL view.
zibzaba
05-31-2010, 02:31 AM
but where i ll put this code ?
highandwild
05-31-2010, 02:39 AM
This is the row source for the combo box.
Test it first in a new query.
Paste the code into SQL View.
gemma-the-husky
05-31-2010, 02:56 PM
but note that you will need some special coding for this
normally your combo box identifies a particular filter for the form/report query.
Now you are adding an option that say give me an "<ALL>", with a non-existent key value (lets say your combo box returns a number - so the <ALL> row, needs to return, say -1
So unless you change the form/report query, it will now look for a value of -1, find nothing, and return no data.
Hope this makes sense