What I learned about the OrderBy property...

JohnGunn

Registered User.
Local time
Today, 06:59
Joined
Jun 19, 2002
Messages
14
Maybe you guys all know this already, but I spent hours learning it the hard way. I hope it helps someone...

Symptom: Report comes out in order, unless run as a subreport, then order is random.

Obscure Rule #1: You must set the OrderByOn property to Yes ON THE MAIN REPORT. This seems to override OrderByOn on the subreport.

Obscure Rule #2: You can't set the OrderBy or OrderByOn properties in the report from its Open Event code. I tried to do it like this:

Reports![reportname]![subreportname].Report.OrderByOn = -1

This produces the misleading error message 2101--"The setting you entered isn't valid for this property". Actually I believe the message shold read something like "This property is read-only. You may not set it, fella. Tough luck." You can send it a valid setting, but it can't accept it.

HTH
 

Users who are viewing this thread

Back
Top Bottom