Results 1 to 6 of 6
  1. #1
    Join Date
    Oct 2003
    Posts
    3

    Unanswered: Report wizard peculiarity - Help!

    I am using Access 97. I have a table containing fields for [Title], [Forename], [Surname], [HouseNumber], [Street], [City], [PostalCode]. These are picked up in a query which orders them according to [City], [Street], [HouseNumber], [Surname] and [Forename].

    If I create a report based on that query using the Report Wizard, I am offered the option to order the records on up to 4 fields. If I opt not to order on any fields, I thought the query ordering would come through. But it doesn't. OK, fair enough. I then used the wizard to create a report ordering on the first of the 4 fields I wanted. Obviously, I really wanted to 5th field but don't get that option with the wizard.

    So the report comes up and records are ordered according to those 4 fields (but not according to the 5th field - [ForeName]). My question is 'what is the property which stores the information to sort on those 4 fields?' It's not the Order By / Order By On properties. And if I search in the report object's properties, I can't find any reference to ordering on those fields.

    How can I add the 5th field ([ForeName]) to the ordering?

    Once the ordering is set by the wizard, the Order By property seems to be ignored. Where am I going wrong?

  2. #2
    Join Date
    Oct 2003
    Location
    Canada
    Posts
    574
    When designing your report, there is probably a tool in the toolbar that has a control tip text of Sorting and Grouping. Use that.

  3. #3
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1

    Lightbulb

    In the Report_Open Event you can do this code:



    Me.OrderByOn = True
    Me.OrderBy = "[yourTableName]![FirstField],
    [yourTableName]![SecondField],
    [yourTableName]![ThiredField],
    [yourTableName]![FourthField],
    [yourTableName]![FivthField] "





  4. #4
    Join Date
    Oct 2003
    Posts
    3
    Thanks, Hammbakka. Your suggestion worked perfectly. I'd been struggling with the problem for the last week. Should've come here straight away!

  5. #5
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740
    there's also a non-code way: right-click the report in design view and select Sorting & Grouping.

    izy
    currently using SS 2008R2

  6. #6
    Join Date
    Oct 2003
    Posts
    3
    Izyrider, tried your route, too. Excellent! Just what the doctor ordered!

Posting Permissions

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