Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2002

    Question Unanswered: OrderBy Report Problem

    Hello, all!

    I'm trying to change the sort order in a report by setting the property
    "OrderBy" to something during the Report_Open event.

    I've set the property "OrderByOn" to TRUE on the line just before this one.

    However, it seems like the report totally ignores the "OrderBy" setting. The "Filter" and "FilterOn" properties works as expected.

    What am I doing wrong?!?

    BTW, I'm using MS Access 97.

    I would very much like to hear your opinions!

    Best Regards,

  2. #2
    Join Date
    Jun 2003
    For dakapl :

    I experienced some time ago the same problem and solved it like this :

    DoCmd.OpenReport "rptAnalyses", acPreview
    'give user opportunity to change the order of the report
    If MsgBox("Order by risk number?", vbYesNo) = vbYes Then
    Reports![rptAnalyses].OrderBy = "risknr,stepnr"
    Reports![rptAnalyses].OrderBy = "stepnr,risknr"
    End If
    Reports![rptAnalyses].OrderByOn = True

    This works real fine for me. The problem with your code could be that you try to set the OrderBy property before the report is open.
    Try to open the report first and then set the OrderBy property and at last set the OrderByOn to TRUE

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts