YES...create 2 groups with the same formula as described above... except each modified as follows:
formula for group 1
If {?SortOrder} = "UserID" and {?sortdir} = "ASC" then SortOrderVar1 := {TableName.UserID}
else If {?SortOrder} = "UserName" and {?sortdir} = "ASC" then SortOrderVar1 := {TableName.UserName}
else SortOrderVar1 = "1";
formula for group 2
If {?SortOrder} = "UserID" and {?sortdir} = "DES" then SortOrderVar2 := {TableName.UserID}
else If {?SortOrder} = "UserName" and {?sortdir} = "DES" then SortOrderVar2 := {TableName.UserName}
else SortOrderVar2 = "1";
in "the Change Group options" Group 1 would have the records sorted "Desending" whereas Group 2 would have the records sorted "Ascending".
Note: the only differences betwwen these formulas is that one group or the or is set to a constant (ie. the group has no effect) depending on the new parameter called "Sortdir"
if you have stuff you want displayed in the header or footers of these groups just make sure the fields are the same in both headers or footers and suppress the group you don't want to see....otherwise if there are not fields in these sections then jus suppress headers and footers for these groups
never tried this before but it should work....will keep it mind for myself...thanks for the idea
Jim