Solved

ms access 2010 + add blank value to combo box

Posted on 2011-02-14
9
1,308 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 119

Expert Comment

by:Rey Obrero
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 119

Accepted Solution

by:
Rey Obrero 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
 
LVL 119

Expert Comment

by:Rey Obrero
ID: 34893447
you did not answer the question, the need for the blank value..
0
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 

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 119

Expert Comment

by:Rey Obrero
ID: 34893466
use a union query...
0
 
LVL 119

Expert Comment

by:Rey Obrero
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 119

Expert Comment

by:Rey Obrero
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.

762 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now