ComboBox Question

  • Thread starter Thread starter Brian
  • Start date Start date
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!
 
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.
 
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.
 
Back
Top