473,398 Members | 2,165 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Alternate sorting for Access report

I have a report whose record source is a query. The query includes an
ORDER BY clause that sorts on a particular set of columns. I would
like to be able to run the same report with the same input data, sorted
on a different set of columns. Aside from copying (^C, ^V) the report
and changing the Record Source property in the new copy to another
query, is there an elegant way to accomplish this?

Thanks

Rick

Apr 25 '06 #1
8 4650
Look at QueryDef in the Help file. You use a single query but change the
query's SQL programatically.

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
Over 1175 users have come to me from the newsgroups requesting help
re******@pcdatasheet.com
<nn****@optonline.net> wrote in message
news:11**********************@i39g2000cwa.googlegr oups.com...
I have a report whose record source is a query. The query includes an
ORDER BY clause that sorts on a particular set of columns. I would
like to be able to run the same report with the same input data, sorted
on a different set of columns. Aside from copying (^C, ^V) the report
and changing the Record Source property in the new copy to another
query, is there an elegant way to accomplish this?

Thanks

Rick

Apr 25 '06 #2
nn****@optonline.net wrote in message
<11**********************@i39g2000cwa.googlegroups .com> :
I have a report whose record source is a query. The query includes
an ORDER BY clause that sorts on a particular set of columns. I
would like to be able to run the same report with the same input
data, sorted on a different set of columns. Aside from copying (^C,
^V) the report and changing the Record Source property in the new
copy to another query, is there an elegant way to accomplish this?

Thanks

Rick


My opinion is to never rely on other methods of sorting than the
sorting
and grouping thingie within the report itself. Any sorting and qrouping
in the recorsource, is usually ignored.

Check this article at Allen Brownes, for how to manipulate it
programatically
http://allenbrowne.com/ser-33.html

--
Roy-Vidar
Apr 25 '06 #3
"PC Datasheet" <fa***@email.com> wrote in message
news:oA*****************@newsread3.news.atl.earthl ink.net...
Look at QueryDef in the Help file. You use a single query but change the
query's SQL programatically.


<sigh>

Yet another wrong answer just to plug your "resource". A report's sorting
and grouping will always override that of the bound data source. The
correct answer is to code the grouping and sorting in the report's open
event.

Keith.
www.keithwilby.com
Apr 25 '06 #4


"PC Datasheet" <fa***@email.com> wrote in message
news:oA*****************@newsread3.news.atl.earthl ink.net...
Look at QueryDef in the Help file. You use a single query but change the
query's SQL programatically.


This is a useful contribution? Why not tell him to look at the Access
documentation?

John... Visio MVP
Apr 25 '06 #5

"PC Datasheet" <fa***@email.com> schreef in bericht news:oA*****************@newsread3.news.atl.earthl ink.net...
Look at QueryDef in the Help file. You use a single query but change the
query's SQL programatically.
This is not a bright answer.
With reports you can't rely on Access using the Order By from the recordset ...
--
-- PC Datasheet
Your Resource For Help With Access, Excel And Word Applications 'Resource ????
Over 1175 users have come to me from the newsgroups requesting help '1175 users ????
re******@pcdatasheet.com


--
To Steve:
No-one wants your advertising/job hunting here!
Over 750 !! users from the newsgroups have visited the website to read what kind of a 'resource' you are... (rapidly increasing..)

To the original poster:
Most people here have a common belief that the newsgroups are for *free exchange of information*.
But Steve is a notorious job hunter in these groups, always trying to sell his services.
And he is known here as a shameless liar with no ethics at all.

Before you intend to do business with him look at:
http://home.tiscali.nl/arracom/whoissteve.html

Arno R
Apr 25 '06 #6
Thank you all for your quick and insightful replies. The app in its
present state has a form that kicks off the report. On the form I'd
like to have two command buttons, each invoking the same report but
each with a different sorting scheme. If I ditch the query and use the
Order By property of the report instead, somehow the form must advise
the report how to configure that property to sort in one of the two
schemes. I figure that would happen in VBA code, but how exactly?
Should the form directly manipulate the property object in the report?
Or should the Open event in the report call back to the form to get the
sorting specs?

Thanks again

Apr 25 '06 #7
> Should the form directly manipulate the property object in the report?
Or should the Open event in the report call back to the form to get the
sorting specs?


The latter. The report needs to check a value on your form.
If you *need* the two command buttons on your form, you can set a (hidden) value in an optiongroup or similar.
You could also only use an optiongroup next to a single command button.

Check out the link that Roy gave you in this thread.
http://allenbrowne.com/ser-33.html

Arno R

Apr 25 '06 #8
nn****@optonline.net wrote in
news:11**********************@u72g2000cwu.googlegr oups.com:
Thank you all for your quick and insightful replies. The app in
its present state has a form that kicks off the report. On the
form I'd like to have two command buttons, each invoking the same
report but each with a different sorting scheme. If I ditch the
query and use the Order By property of the report instead, somehow
the form must advise the report how to configure that property to
sort in one of the two schemes. I figure that would happen in VBA
code, but how exactly? Should the form directly manipulate the
property object in the report? Or should the Open event in the
report call back to the form to get the sorting specs?


The latter is the way to do it. Open the form as a dialog in the
report's OnOpen event.

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/
Apr 25 '06 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Mat N | last post by:
Hi, I've been trying to work out how to create a report based on crosstab query for which the number of fields is variable. For example in a situation where you show customer billing by year in...
8
by: Mike MacSween | last post by:
tblCourses one to many to tblEvents. A course may have an intro workshop (a type of event), a mid course workshop, a final exam. Or any combination. Or something different in the future. At...
4
by: Marie | last post by:
My report has a text field named ItemNum. Most records have a value for ItemNum. I set Grouping And Sorting to sort ascending on the ItemNum field. The records where ItemNum is Null appear at the...
5
by: Mike | last post by:
Hello All, I have a report based upon a query. I have added a control to report footer that calcs the total cost of the inventory: =SUM(). When this total calculation is NOT on the report,...
3
by: ChadDiesel | last post by:
I've been posting questions here the last week, but if you don't know my situation: I have a "Print Labels" button on the subform that sends the appropriate box information on the subform to a...
19
by: Owen T. Soroke | last post by:
Using VB.NET I have a ListView with several columns. Two columns contain integer values, while the remaining contain string values. I am confused as to how I would provide functionality to...
3
by: Don | last post by:
I have a "Report" that is created from a "Form". It prints a list of items, you may consider it a shopping list. In any event I use to run this in alphabetical order but have since decided to run...
2
by: jonosborne | last post by:
Hi, i have literally been racking my brain about this one and i think i need some help. I have a report which is produced when a button on a form is pressed. The report has many fields and records...
1
by: jjjoic | last post by:
Hi, I use Access 2003 to generate the back-end data for a ColdFusion report at work. The report is sorted by a column and based on the sorting, rankings are assigned to each row(i.e. the biggest...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.