Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

User - Selectable Criteria...

Status
Not open for further replies.

danomaniac

Programmer
Jan 16, 2002
266
US
Hello,
I've built a report in Access and am now building a form to launch it with option groups for users to set criteria. I'm having difficulty setting the OrderBy property. I want the user to select if the report is sorted either by Part Number, or by Inventory level, and either Ascending or Descending.

I've tried entering in the report's Open event,

Select Case Forms!frmName.FrameSort.Value
Case is = 1: Me.OrderBy = "InvPercent DESC"
Case is = 2: Me.OrderBy = "InvPercent ASC"
Case is = 3: Me.OrderBy = "PartNumber DESC"
Case is = 4: Me.OrderBy = "PartNumber ASC"
End Select

Should I change the sorting in the query instead of the report?
Am I putting the code in the wrong place?
Do the Header/Footer sortings and groupings override the code?

Any help would be appreciated.


"It's more like it is now, than it ever has been."
 
are you just wanting it to sork by on this?
and also do you have any grouping in this report?

Brought to you By Nedaineum
 
Yes, there are groupings in the report. And yes, I want to sort by one of two fields, either ascending or descending.

"It's more like it is now, than it ever has been."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top