[AccessD] Access 2007 Report - Sort Puzzler - The Plot Thickens (Sub-Report)

Brad Marks BradM at blackforestltd.com
Wed Nov 14 11:47:17 CST 2012


Charlotte,

Thanks again for your explanation on this issue.

I have a small test application (with a simple report) working nicely with this code -

DoCmd.OpenReport "Report1", acViewReport, "", "", acNormal
Reports.Report1.OrderBy = "Field1"


Now I am trying to control the order of data on a sub-report.
This sub-report's data is not at all tied to the main report's data.
(Different database, different table, different query).

I had planned to simply change the underlying query def with VBA code, but as you pointed out, this will not work.

I can't figure out where to place the statement to control the "Orderby" for the sub-report.

I have tried several tests but nothing works.

Thanks,
Brad 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



-----Original Message-----
From: accessd-bounces at databaseadvisors.com on behalf of Charlotte Foust
Sent: Tue 11/13/2012 7:51 PM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] Access 2007 Report - Sort Puzzler
 
It's easy to forget even if you know it.

Charlotte

On Tue, Nov 13, 2012 at 12:10 PM, Brad Marks <BradM at blackforestltd.com>wrote:

> Charlotte,
>
> Thanks for the help.
>
> What you wrote explains why I am seeing these results.
>
> This really surprises me!  I thought that reports would receive data
> from the query in the order that is shown when a person looks directly
> at the query.  I also thought that reports would show the data in the
> same order as they receive it.  (I was wrong)
>
> I really appreciate the insights.  This is good info to know.
>
> I was starting to pull my hair out on this one  :-)
>
> I owe you a big margarita !
>
> Brad
>
>
>
> -----Original Message-----
> From: accessd-bounces at databaseadvisors.com
> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte
> Foust
> Sent: Tuesday, November 13, 2012 1:55 PM
> To: Access Developers discussion and problem solving
> Subject: Re: [AccessD] Access 2007 Report ?Sort Puzzler?
>
> Reports ignore the underlying query sort.  You have to use sorting and
> grouping on the report or apply the OrderBy and OrderByOn options to get
> what you need.
>
> Charlotte
>
> On Tue, Nov 13, 2012 at 9:07 AM, Brad Marks
> <BradM at blackforestltd.com>wrote:
>
> > All,
> >
> > I have a small test application that is yielding strange results that
> I
> > cannot figure out.
> >
> > There is only one table and one query.
> >
> > The query is sorted on a field called "Customer Name".
> >
> > This works fine.
> >
> > There are two reports.  The original report keeps showing the data in
> > order by "Sales Order Number".
> >
> > When I go into Design View for this report, I cannot see any "Group"
> or
> > "Sort" for this report.
> >
> > Just for fun, I used the Report Wizard to set up a second report (also
> > with no sorts).  This second report returns the data correctly.  (in
> the
> > same order as the underlying query).
> >
> > I must be missing something.  I have run many tests and cannot see
> what is
> > causing this problem.
> >
> > Has anyone else seen this happen?
> >
> > Thanks,
> > Brad
> >
> > --
> > AccessD mailing list
> > AccessD at databaseadvisors.com
> > http://databaseadvisors.com/mailman/listinfo/accessd
> > Website: http://www.databaseadvisors.com
> >
> >
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>
> --
> This message has been scanned for viruses and
> dangerous content by MailScanner, and is
> believed to be clean.
>
>
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>
-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.




More information about the AccessD mailing list