Solved

Assign "None Selected" in combobox

Posted on 2006-07-11
3
387 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
  • 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

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

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

As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
Familiarize people with the process of utilizing SQL Server views 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 Access…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

679 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