Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Add blank entry to dropdown list

Status
Not open for further replies.

thefourthwall

IS-IT--Management
Feb 26, 2002
387
US
Good morning,

Stuck on an issue that I would appreciate your help with. In a database I maintain there is a combobox called [bold]Agency[/bold] on the main form.

If the users accidentally selects an item on the list, I want the dropdown list to have a blank entry at the top that can be chosen instead. Currently the combo box is populated only by entries in tblAgency and the row source for the combobox is
Code:
SELECT tblAgency.Agency FROM tblAgency;
. I generate a report that displays records only when an item from this list has an entry from tblAgency.

I imagine that the solution is relatively easy, but after searching this forum and not finding an answer, maybe it is just not easy for me.

Your help sure is appreciated!

-thefourthwall
 

Duane's solution will work quite well. I have also used something like:
Code:
Select tblAgency.Agency FROM tblAgency
UNION 
SELECT "(None)" FROM tblAgency
ORDER BY tblAgency.Agency;
because some people find selecting '(None)' more intuitive than just a blank space. The '(' will cause '(None)' to sort to the top of the list (assuming you have no other choices that start with odd characters.)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top