Re: Sorting Problem in my Report

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Sky Warren (SkyWarren_at_discussions.microsoft.com)
Date: 02/19/05


Date: Fri, 18 Feb 2005 19:01:07 -0800

Graham,

You were right about the Sorting and Grouping window. In my query I created
a new column called Expr1 and applied the DatePart function to sort on the
day of the week. The new column looks like this:

Expr1: DatePart("d",[Policy Date])

Then, in my report in the Sorting and Grouping window I selected the new
column from my query named Expr1 and set it to Sort Ascending. In the same
window under Group Properties I set:

Group Header = No
Group Footer = No
Group On = Each Value
Group Interval = 1
Keep Together = No

Now the report sorts chronilogically in perfect order. Thank you for
pointing me in the right direction Graham. I hope this post helps others with
similar problems.

-Sky

"Graham Mandeno" wrote:

> Hi Sky
>
> For some reason, forms obey the ORDER BY clause in the RecordSource, but
> reports do not. You need to go to the Sorting and Grouping window (View >
> Sorting and Grouping) and define your sort criteria there.
> --
> Good Luck!
>
> Graham Mandeno [Access MVP]
> Auckland, New Zealand
>
> "Sky Warren" <SkyWarren@discussions.microsoft.com> wrote in message
> news:E5D3ADD7-75A2-497E-A5FA-7EC89998E7A2@microsoft.com...
> > Hello to all,
> >
> > I have a report that's bound to a query. The query uses the DatePart
> > function to sort on the Policy Date field. When the query runs alone the
> > sort
> > works fine, but when the query is called from the report the output is
> > unsorted. The report gets called from my form named Control Panel. Can
> > anyone
> > help me solve this?
> >
> > Here is the code from the form:
> >
> > Private Sub Anniversaries_AfterUpdate()
> > DoCmd.OpenReport "Client Anniversary", acViewPreview
> > End Sub
> >
> > Here is the code from the query:
> >
> > SELECT DISTINCTROW Clients.[First Name], Clients.[Last Name],
> > Clients.Address, Clients.City, Clients.State, Clients.[Zip Code],
> > Clients.[Policy Date]
> > FROM Clients
> > WHERE (((Month([Clients].[Policy Date]))=[Forms]![Control
> > Panel]![Anniversaries]))
> > ORDER BY DatePart("d",[Policy Date]);
> >
> >
>
>
>



Relevant Pages

  • RE: Sorting in Query and Report involving look up combo box
    ... That is the problem with lookup fields. ... query and the report and the best way to do that is having the look up field. ... I have the report grouped by Artist Name and then Sorted by Style Number ... And, as I said before, Reports ignore the sort order of a query. ...
    (microsoft.public.access.reports)
  • RE: Sorting in Query and Report involving look up combo box
    ... query and the report and the best way to do that is having the look up field. ... I have the report grouped by Artist Name and then Sorted by Style Number ... how do you have your sorting and grouping set up in your report. ... And, as I said before, Reports ignore the sort order of a query. ...
    (microsoft.public.access.reports)
  • RE: Multiple sort query
    ... to sort by location, she would just select a person from the location drop ... then an employee from the drop down, and select run query. ... in turn run a report based on what was selected. ... list all employees they manage, a location report list all employees at that ...
    (microsoft.public.access.queries)
  • Re: Report Sorting
    ... "ricseb" wrote: ... Sort by "Collection Date". ... query that has all of the above fields, but am at a loss as to how to ... populate this report in the above order. ...
    (microsoft.public.access.reports)
  • RE: Separate Sort Order within same record
    ... If your report is not based upon a query then create one. ... Modify the query by opening in design view. ... Ascending or Descending in the Sort row remove the sort. ...
    (microsoft.public.access.reports)