Results 1 to 4 of 4
  1. #1
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    San Francisco, California, USA
    Posts
    358
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Reports: Passing 'Order By' (Access 97, Win 95/98)

    Hi all!

    I'm probably having a duh moment, so I'm hoping someone out there can help straighten me out....

    I have a form that builds the "WhereCriteria" of both a form and a report.

    If I want the sort options to pass through to the form, I can use OpenArgs to pass an Order by value.

    If I want the sort options to pass through to the report, what do I do? There is no OpenArgs of the report. I tried including "Order by" in the WhereCriteria statement, but it gives me a syntax error.

    Is the only way around this to create a global variable to pass the information?
    And, for kicks, if this is true, is it fixed in XP? (countdown has started, 5 days until we convert from 97 to XP)

    TIA!

    Cecilia :-)

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Reports: Passing 'Order By' (Access 97, Win 95/98)

    Reports have no OpenArgs indeed.

    You can set the sort order of the report in the Report_Open event:

    Private Sub Report_Open(Cancel As Integer)
    Me.OrderBy = Forms![frmMyForm].OrderBy
    Me.OrderByOn = True
    End Sub

    where you must replace frmMyForm by the name of the form you use to set the criteria and sort order.

    Note 1: in order to do this, you must *not* specify a sort order in the design of the report (Sorting and Grouping window). A pre-set sorting order will overrule the sorting order you set in code.

    Note 2: I have no idea about XP.

  3. #3
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    San Francisco, California, USA
    Posts
    358
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Reports: Passing 'Order By' (Access 97, Win 95/98)

    Thanks Hans. I was hoping there was some other way that I had forgotten, but I guess that's it. Bummer.

    Ceci :-)

  4. #4
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Reports: Passing 'Order By' (Access 97, Win 95/98)

    Access XP reports have an OpenArgs property, although I haven't tried to use it.
    Charlotte

Posting Permissions

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