sorting calculated field access report

vagues0ul

Registered User.
Local time
Today, 12:32
Joined
Sep 13, 2018
Messages
103
i have a calculated field in access report and when i sort report on that field it gives me this error.

Operation is not supported for this type of object

the field is from a table where it is calculating average of 3 other fields.
 
Calculate in the source and then sort on it?
 
Is the calculation in textbox on report? Calculate in the report RecordSource query. Use that field for sorting.

Otherwise, use the expression as sort parameter in the report design, not the textbox.
 
Last edited:
Is the calculation in textbox on report? Calculate in the report RecordSource query. Use that field for sorting.

Otherwise, use the expression as sort parameter in the report design, not the textbox.

am i doing it right ?

Code:
Private Sub Report_Load()
Report.OrderBy = "[termttl]*0.4 + [stmttl]*0.6 Desc"


End Sub
 
I have never used VBA to set a report OrderBy property. Either set the property in design or use report Sorting & Grouping.

If you have any Sorting & Grouping setup, the OrderBy property will be ignored. Sorting & Grouping takes precedence.

I presume report is named something other than "Report". Correct syntax:

Me.OrderBy = "[termttl]*0.4 + [stmttl]*0.6 Desc"
 
Don't do this with code, modify the report itself. Open the report in design view and add a sort option using the sorting & grouping dialog. Reference the calculated field in the RecordSource.
 
Don't do this with code, modify the report itself. Open the report in design view and add a sort option using the sorting & grouping dialog. Reference the calculated field in the RecordSource.

the error i posted is the result of same steps you are mentioning
 
We are going in circles. Suggestions are proven methods. If you want to provide db for analysis, follow instructions at bottom of my post.
 

Users who are viewing this thread

Back
Top Bottom