Conditional sort on report

vmon

Registered User.
Local time
Today, 10:19
Joined
Jan 21, 2003
Messages
49
I have a report that I want to sort two different ways depending on user selection. I am having trouble getting an expression to work inthe Sort/Group By on the report.

I setup an if like this.

Iif(OptSort = 1,Item, Location)

Can I put an if statement in the Sort/Group By?

thanks,
vmon
 
Got it

I can set the Sort/Group By and then in the On Open event I can change the group level.

Here is what I did.

Select Case Forms!frmMfMRP1Rpt!OptPrintBy
Case 1 '* By Item ID
Me.GroupLevel(0).ControlSource = "ItemId"
Case 2 '* By Location ID
Me.GroupLevel(0).ControlSource = "Location"
Me.GroupLevel(1).ControlSource = "ItemId"
End Select
 

Users who are viewing this thread

Back
Top Bottom