![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Here is BenchmarkCategory table. Notice the BenchmarkCategoryName is not sorted alphabetically when sorted by BenchmarkCategoryID. BenchmarkCategory BenchmarkCategoryName BenchmarkCategoryID US EQUITY 1 INTERNATIONAL EQUITY 2 US FIXED INCOME 3 NON-US FIXED INCOME 4 OTHER 5 Here is another table Benchmark with a BenchmarkCategoryID column. I built a form on the table and added a ComboBox displaying the BenchmarkCategoryName. Because users would like to see Names instead of IDs. The right hand Column is a ComboBox based on BenchmarkCatgoryID but displaying BenchmarkCategoryName. Benchmark BenchmarkCode BenchmarkCategoryID BenchmarkCategoryID 3molib2 5 OTHER dowwil 5 OTHER sbwld 4 NON-US FIXED INCOME sbnonus 4 NON-US FIXED INCOME ml3to7 3 US FIXED INCOME sbhiyld 3 US FIXED INCOME eem 2 INTERNATIONAL EQUITY msworld 2 INTERNATIONAL EQUITY nasdaq 1 US EQUITY djia 1 US EQUITY My question is how to sort the ComboBox column based on the names, not on IDs? So it looks like the below picture, not the above picture? Benchmark BenchmarkCode BenchmarkCategoryID BenchmarkCategoryID sbhiyld 3 US FIXED INCOME ml3to7 3 US FIXED INCOME djia 1 US EQUITY nasdaq 1 US EQUITY dowwil 5 OTHER 3molib2 5 OTHER sbnonus 4 NON-US FIXED INCOME sbwld 4 NON-US FIXED INCOME eem 2 INTERNATIONAL EQUITY msworld 2 INTERNATIONAL EQUITY I did the above picture by changing the RecordSource on the Benchmark table to select * from Benchmark c order by (select p.BenchmarkCategoryName from BenchmarkCategory p where p.BenchmarkCategoryID = c.BenchmarkCategoryID) desc But this hack doesn't work in SubForms. Using Profiler, I saw ADP sending broken queries to SQL Server. |
![]() |
| Thread Tools | |
| Display Modes | |
| |