dkilby
asked on
ms access 2010 + add blank value to combo box
i have some combo boxes on my form that are populated from different queries, is there a way to add a blank value to the combo boxes so the default value is just a blank value.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
i have multiple drop downs, and i want the user to be able to select a blank value as the user will select the dropdowns to do other things, but they dont have to select a value in each combobox
you did not answer the question, the need for the blank value..
ASKER
so when i check the values of the dropdown box, if it is blank i can ignore and move to the next one, a user might have selected a value and then decided they dont want that option so would select the blank option
use a union query...
<user might have selected a value and then decided they dont want that option >
then just clear the selection made..
then just clear the selection made..
look at the recordsource propert of your combobox and add a union statement. For example,
if the SQL behind the recordsource of the combobox is:
Select CustomerID, CustomerName from Customers.
Change it to:
Select 0 as CustomerID, Null as CustomerName
Union
Select CustomerID, CustomerName from Customers.
order by CustomerName
if the SQL behind the recordsource of the combobox is:
Select CustomerID, CustomerName from Customers.
Change it to:
Select 0 as CustomerID, Null as CustomerName
Union
Select CustomerID, CustomerName from Customers.
order by CustomerName
yeah that is right, but combo boxes does not have recordsource.
you have to place the union query in the rowsource property of the combo
you have to place the union query in the rowsource property of the combo
the question is, why do you need a blank default value?
if nothing is selected from the combo, you can interpret it as blank.