Solved

Assign "None Selected" in combobox

Posted on 2006-07-11
3
396 Views
Last Modified: 2008-02-26
I expect this to be easy, but can't seem to figure it out.

I have a combobox that uses a query for it's recordsource.  How can I add a value to the combolist that states "None Selected."  I want this value to appear as the default when the form is opened as well as be a selection within the drop-down.  However, I do not want to physically add this as a value to the table.

The VBA will capture the logic handling based on the selection.

Thanks!
0
Comment
Question by:bkapla1
[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
  • 2
3 Comments
 
LVL 14

Accepted Solution

by:
bluelizard earned 500 total points
ID: 17081035
in the recordsource add this with a union, e.g.,

  recordsource = select id, text from mytable union all select 99, "none selected" from mytable


--bluelizard
0
 

Author Comment

by:bkapla1
ID: 17081110
Sorry, it's been a while since I've used a Union join.... where exactly would that go... here's my exact SQL:

SELECT dbo_fk_area_codes.area_code, dbo_fk_area_codes.area_name
FROM tbl_DT_DocTrack,  dbo_fk_area_codes
WHERE tbl_DT_DocTrack.Area_Code=dbo_fk_area_codes.area_code
GROUP BY dbo_fk_area_codes.area_code, dbo_fk_area_codes.area_name
ORDER BY dbo_fk_area_codes.area_name;
0
 

Author Comment

by:bkapla1
ID: 17081197
Actually, I figured it out.

Thanks!
0

Featured Post

NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

Question has a verified solution.

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

This article describes two methods for creating a combo box that can be used to add new items to the row source -- one for simple lookup tables, and one for a more complex row source where the new item needs data for several fields.
Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

617 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