[AccessD] Report Data Order Differs From Form or Query DataOrder

Max Wanadoo max.wanadoo at gmail.com
Tue Mar 18 05:38:36 CDT 2008


Actually my mother would always say "Ask your Father"! <smile>

Thanks for all the input, Gustav.

Max


 

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav Brock
Sent: Tuesday, March 18, 2008 10:32 AM
To: accessd at databaseadvisors.com
Subject: Re: [AccessD] Report Data Order Differs From Form or Query
DataOrder

Hi Max

Well, as your mother would answer when she didn't know the answer: Because
it does! 

I guess the reason is that sorting and grouping is considered such an
essential part of what a report does that it has been given full control,
and to gain this all previous sorting is ignored because it will not be used
anyway.
You mention an index and that may be what the report looks for and - if its
own sorting is not specified - will use. I'm just guessing but some tests
could clarify this.

I can see this represents a problem for you. One method could be to use two
variables: one for the SQL expression without sorting, and one to be applied
for the sorting. Then use the OnOpen events of the form and the report to,
respectively, build an Order By expression to be appended the SQL variable
and then used as the form's RecordSource, and be used by a function which
sets the sorting in the report (this is quite easy). This way the unsorted
SQL could remain identical for each pair of form and report.

Actually, I can't think of any other way to achieve this. The sorting
variable could be a series of fieldname/direction like:

  somefield;asc;field2;asc;someotherfield;desc;anotherfield;asc

which easily could be parsed by several methods.

/gustav


>>> max.wanadoo at gmail.com 18-03-2008 10:50 >>>

The Point is this:  Why does the RPORT use a different engine that a FORM
when identical query is used.



--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




More information about the AccessD mailing list