Applying Report's Sort Order via code

T

TBernard

I got great help here in the past with some code to sort
my report through code, depending on choices a user makes
on another form. Here is the code that I currently use
and works correctly:

Select Case Forms!frmOpenIssueReport.frameOrder.Value
Case Is = 1
Me.GroupLevel(1).ControlSource = "MainIssueID"
Case Is = 2
Me.GroupLevel(1).ControlSource = "IssueName"
Case Is = 3
Me.GroupLevel(1).ControlSource = "IssueDate"
Case Is = 4
Me.GroupLevel(1).ControlSource = "Category"
End Select

This is placed on the Open Procedure of the report and
works great. Now the users want to be able to sort the
report by either Ascending or Descending. I have been
playing with the code but have not found a way to do
this. I tried Me.GroupLevel(1).SortOrder but it only
allows True or False.

If anyone has any ideas it would be greatly appreciated.

Thank you,

TBernard
 
M

Marshall Barton

TBernard said:
I got great help here in the past with some code to sort
my report through code, depending on choices a user makes
on another form. Here is the code that I currently use
and works correctly:

Select Case Forms!frmOpenIssueReport.frameOrder.Value
Case Is = 1
Me.GroupLevel(1).ControlSource = "MainIssueID"
Case Is = 2
Me.GroupLevel(1).ControlSource = "IssueName"
Case Is = 3
Me.GroupLevel(1).ControlSource = "IssueDate"
Case Is = 4
Me.GroupLevel(1).ControlSource = "Category"
End Select

This is placed on the Open Procedure of the report and
works great. Now the users want to be able to sort the
report by either Ascending or Descending. I have been
playing with the code but have not found a way to do
this. I tried Me.GroupLevel(1).SortOrder but it only
allows True or False.


You're on the right track, True is for Descending, False fo
Ascending.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top