Rdemoveallsummarries and removesummaries 7 don't always work

I have this code, where «Transaction number» has values like “IE 18/035” or “LS 17/234”:

field «Transaction number»
    sortdown
    maximum
    lastrecord
    let lvLastTrans =  «Transaction number»
    firstrecord
    removeallsummaries

The sortdown statement is there for other reasons. If I omit the firstrecord statement, the summary record is not removed. If I select the summary record in a form and open the data sheet, the sheet displays as completely empty. I have to select another record in the form to view records in the sheet. Can anybody replicate any of this?

In Panorama X, I would highly recommend using this technique to get the maximum value in a field into a variable:

let lvLastTrans = aggregate(|||«Transaction number»|||, "maximum")

I don’t think too many people have used it, but the aggregate( function is one of my favorite new features in Panorama X.

I like it! One of these days I’m going to read through the Help wizard from top to bottom (again) - there’s so much new stuff I’ve never even heard of.

Yes, I am learning about the aggregate function and I like it, too.

But Michael, when you use the sortdown statement, the first record contains the maximum value already. No need for a summary record.

As Homer would say, Doh!