[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 539
  • Last Modified:

Combo Box Blank Value Choice

I would like a combo box which is based on a table with no blank values, to show a blank value as one of its choices.
0
tonydemarco
Asked:
tonydemarco
  • 2
1 Solution
 
rockiroadsCommented:
your sql that its based on, u create a row
e.g.

select top 1 '' as blankitem from sometable
union all
select field1 from sometable


for each field u select, ensure that many rows are in the other query
0
 
Jim HornMicrosoft SQL Server Developer, Architect, and AuthorCommented:
You'll have to use as your combo box a RowSource that goes something like this...

SELECT "", " < Nothing > "
FROM YourTable
UNION SELECT SomeIDField, SomeColumn
FROM YourTable

{Assumes that first column is the id field, hidden, and the second column is the displayed column, visible}
0
 
tonydemarcoAuthor Commented:
Jim,

SELECT "" AS servco_no
FROM dbo_service_company
UNION SELECT servco_no
FROM dbo_service_company

gives me all values in table plus a blank at the top.

Thanks!
0
 
Jim HornMicrosoft SQL Server Developer, Architect, and AuthorCommented:
Thanks for the grade.  Good luck with your project.  -Jim

0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now