Grouping and Sorting problem :confused:

jlocke

Registered User.
Local time
Today, 11:50
Joined
Jul 23, 2002
Messages
31
I have a report that was being sorted by an option box which allowed me to select which filed to set the sort by option. I had to make a changes to the report design to group by "Property Address" using the Grouping and Sorting options, now when i select a different sort option in my option box the selection gets ignored. I don't want to my several version of the same report to accomodate this issue.

Thank you
 
Once you add group headers/footers to a report it doesn't make sense to change the sort order. That would mess up the group breaks.
 
sorting grouped reports

Why wouldn't make sense? i want grouped items and then want to be able to sort on different fields, say i want sorting on column A then another time sort on column B or C?

Joe
 
The report itself controls how the recordset is sorted once you add grouping. You need to modify the settings in the report itself. Modifying the query won't do you any good. In fact having an order by clause in the query itself is wasteful since Access sorts the query's recordset and then the report sorts it again to get it into the order necessary for the grouping option.
 
Place Code in the On Open event of the Report
To do your Sorting,

Something like the following

Private Sub Report_Open()
If Forms!YourFormName!CheckBoxA = True Then
Me.OrderBy = "ColumnA"
Else
If Forms!YourFormName!CheckBoxB = True Then
Me.OrderBy = "ColumnB"
End If
Me.OrderByOn = True
End If

You'll have play with it a little bit

Hope this helps, I not strong in writing Code
 

Attachments

Last edited:

Users who are viewing this thread

Back
Top Bottom