Picture this:
A combo box on a form has an SQL statement for a row source:
Eg. "SELECT DISTINCT City FROM tblCustomer"
This obviously populates the combo box with a unique list of all the cities in the tblCustomer table. Lets say the the users makes a selection from the combo box to run a sales report by city - by using the SELECT DISTINCT statement as a row source, the combo box will always show all the cities in the table.
To provide the user with an option to run the sales report for ALL cities, use the UNION statement to create a dummy record:
Eg. "SELECT DISTINCT City FROM tblCustomer UNION SELECT 'ALL' AS City FROM tblCustomer"
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.