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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dynamically Sort a Report 1

Status
Not open for further replies.

dcurtis

Technical User
May 1, 2003
273
US
Access XP. (different project than the 2 page report that I posted......)

I have a report (based on a query) that contains several fields that the users would like to be able to sort by. Rather than create individual reports for each I tried to create one which could be dynamically created. I then created a form with combo boxes to determine which client (I can get that to work fine) listing to show. The second combo box (Sort) want to set what to sort by. Click a button to generate the report.

In the report itself, I set the Order By property to [Forms!][frmCreateReport]![Sort] and set the Order By On to yes. However, the report will not sort, no matter the choice in the combo box, the records always show up in the same order.

Any Ideas?

----
A program is a spell cast over a computer, turning input into error messages.
 
put it in the report's OnOpen event:

Me.OrderBy = Forms!frmCreateReport!Sort
Me.OrderByOn = True
 
Works like a charm. As usual, someone on this site has saved my day. THANKS!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top