Solved

ms access 2010 + add blank value to combo box

Posted on 2011-02-14
9
1,311 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
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 

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

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Link Excel Spreadsheet to Access, not using Transferspreadsheet 5 31
DSum for Access 6 47
Web based Access Database and licencing 5 30
access pop-up form 3 9
It took me quite some time to sort out all the different properties of combo and list boxes available from Visual Basic at run-time. Not that the documentation is lacking: the help pages are quite thorough and well written. The problem was rather wh…
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…
Familiarize people with the process of utilizing SQL Server stored procedures 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 Micr…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

863 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

20 Experts available now in Live!

Get 1:1 Help Now