ComboBox Question

B

Brian

I have a combo box that uses a Row Source Type of Table/Query and a Row
Source that is a SQL Statement. Basically, the combo box lists all of the
Contact Names in my database. I would like to be able to add "Add Contact"
and "Edit Contact" as the first two items of the list. Is there any way to
do this?

My SQL Statement is:
SELECT dbo_tbl_Contacts.str_ContactID, dbo_tbl_Contacts.str_CompanyName,
dbo_tbl_Contacts.str_FirstName, dbo_tbl_Contacts.str_LastName FROM
dbo_tbl_Contacts WHERE (((dbo_tbl_Contacts.str_CompanyName) Is Not Null) AND
((dbo_tbl_Contacts.bit_Delete)=0)) ORDER BY dbo_tbl_Contacts.str_CompanyName;

Thanks to anyone that responds!
 
D

Douglas J. Steele

SELECT str_ContactID, str_CompanyName, str_FirstName, str_LastName
FROM dbo_tbl_Contacts
WHERE (str_CompanyName Is Not Null
AND bit_Delete)=0
UNION
SELECT Null, " Add Contact", Null, Null
FROM dbo_tbl_Contacts
UNION
SELECT Null, " Edit Contact", Null, Null
FROM dbo_tbl_Contacts
ORDER BY str_CompanyName

The spaces in front of Add Contact and Edit Contact is to ensure that they
at the top of the list.
 
B

Brian

Doug...you are a genius!


Douglas J. Steele said:
SELECT str_ContactID, str_CompanyName, str_FirstName, str_LastName
FROM dbo_tbl_Contacts
WHERE (str_CompanyName Is Not Null
AND bit_Delete)=0
UNION
SELECT Null, " Add Contact", Null, Null
FROM dbo_tbl_Contacts
UNION
SELECT Null, " Edit Contact", Null, Null
FROM dbo_tbl_Contacts
ORDER BY str_CompanyName

The spaces in front of Add Contact and Edit Contact is to ensure that they
at the top of the list.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top