ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Problem Sorting (https://www.excelbanter.com/excel-programming/385598-problem-sorting.html)

bw

Problem Sorting
 
If I put [DBNum]*1000+[Inst Num] in the Sorting and Grouping box, it
sorts correctly.

The value of: [Forms]![boxSeats]![SortBy] can be 1 or 2.
I want to sort by [BankName] if 1.
I want to sort by [DBNum]*1000+[Inst Num] if 2.

I am putting the following in the Sorting and Grouping box, (this
doesn't sort properly):

=IIf([Forms]![boxSeats]![SortBy]=1,[BankName],[DBNum]*1000+[Inst Num])

When "SortBy" is 1, it sorts okay. When "SortBy" is 2, it DOES NOT
sort properly.

Can someone suggest what I'm doing wrong?





bw

Problem Sorting
 
Oooops!
Sorry, wrong group. Please ignore.


"bw" wrote in message
...
If I put [DBNum]*1000+[Inst Num] in the Sorting and Grouping box, it
sorts correctly.

The value of: [Forms]![boxSeats]![SortBy] can be 1 or 2.
I want to sort by [BankName] if 1.
I want to sort by [DBNum]*1000+[Inst Num] if 2.

I am putting the following in the Sorting and Grouping box, (this
doesn't sort properly):

=IIf([Forms]![boxSeats]![SortBy]=1,[BankName],[DBNum]*1000+[Inst Num])

When "SortBy" is 1, it sorts okay. When "SortBy" is 2, it DOES NOT
sort properly.

Can someone suggest what I'm doing wrong?







All times are GMT +1. The time now is 02:06 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com