Solved

ms access 2010 + add blank value to combo box

Posted on 2011-02-14
9
1,315 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

 
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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
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…

749 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