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!

combo box based on view not sorting properly

Status
Not open for further replies.

jordanking

Programmer
Sep 8, 2005
351
Hello,

I have begun the fun task of upsizing an access db to a adp front end with a sql 2005 express backend. I have a form with a combo box based on a view. The view has some ascending sort values and it displays properly when opened by itself. But when it is specified as the list value for the combo box, the sorting is ignored. does anyone have an idea as to why this happens.

this is the view:
Code:
SELECT      TOP 100 PERCENT idsCompanyID, txtName + ' ' + ISNULL(txtBranch, '') AS Company, txtPhone, txtName, txtBranch
FROM          dbo.tblCompany
ORDER BY txtName, txtBranch
 
This version of the view does not sort properly as well,

Code:
SELECT      TOP 100 PERCENT idsCompanyID, txtName + ' ' + ISNULL(txtBranch, '') AS Company, txtPhone
FROM          dbo.tblCompany
ORDER BY txtName + ' ' + ISNULL(txtBranch, '')

 
Have you tried something like:


Code:
[b]
SELECT TOP 100 PERCENT Company, txtPhone, txtName, txtBranch 
FROM
([/b]SELECT TOP 100 PERCENT idsCompanyID, txtName + ' ' + ISNULL(txtBranch, '') AS Company, txtPhone, txtName, txtBranch
FROM          dbo.tblCompany[b])[/b]
ORDER BY txtName, txtBranch

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top