Re: Sorting Problem in my Report
From: Sky Warren (SkyWarren_at_discussions.microsoft.com)
Date: 02/19/05
- Next message: Paul Ponzelli: "Re: Can Access handle this configuration, or do I need SQL Server?"
- Previous message: Ken Snell [MVP]: "Re: Using SQL statement to append a recordset to a table"
- In reply to: Graham Mandeno: "Re: Sorting Problem in my Report"
- Messages sorted by: [ date ] [ thread ]
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]);
> >
> >
>
>
>
- Next message: Paul Ponzelli: "Re: Can Access handle this configuration, or do I need SQL Server?"
- Previous message: Ken Snell [MVP]: "Re: Using SQL statement to append a recordset to a table"
- In reply to: Graham Mandeno: "Re: Sorting Problem in my Report"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|