Solved

ms access 2010 + add blank value to combo box

Posted on 2011-02-14
9
1,312 Views
Last Modified: 2012-05-11
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.
0
Comment
Question by:dkilby
  • 6
  • 2
9 Comments
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 34893350


the question is, why do you need a blank default value?

if nothing is selected from the combo, you can interpret it as blank.
0
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 500 total points
ID: 34893352
you can add a blank row by using a union query.
0
 

Author Comment

by:dkilby
ID: 34893387
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
0
The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 34893447
you did not answer the question, the need for the blank value..
0
 

Author Comment

by:dkilby
ID: 34893454
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
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 34893466
use a union query...
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 34893470
<user might have selected a value and then decided they dont want that option >

then just clear the selection made..
0
 
LVL 6

Expert Comment

by:PJBX
ID: 34893806
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
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 34893858
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
0

Featured Post

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How can you open the FORM2 2 31
vba sql wild card passing in code 3 23
A Function to parse a text string 4 36
ms access filter query with empty combobox 5 29
Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question