Change Sort By order of a report from a Form

G

Guest

I want the form that sets up a report to be able to choose the sort order.
Say if Forms!MyForm!MyFrame = 1, then Sort by Creditor Name and if =2 then
sort by date of last payment. Say the report has a report header, a detail
section, but no section headers/footers. Can anyone help me with a code
example. The "help" for OrderBy and OrderByOn did not explain enough.
 
G

Guest

Sorry but my IE V6 browser cannot find the URL you sent me (ending
ser-33.html). Is it correct?
 
G

Guest

Found your article. I suppose it doesn't matter what I set the Grouping and
Sorting Dialog to be because it will be changed by the code. Now, how do I
set the sort order to DESC? Thanks....
 
G

Guest

OK got the answer from on-line help. To set the sort order descending, specify:

Me.GroupLevel(0).SortOrder = True

Thanks for the help...
 
G

Guest

Dear Allen,

I followed your method (see my subsequent posts) and it works great. I open
a form from the report On Open event to obtain the report sort criteria. I
included a button to make the report Visible = False. The next thing in my On
Open event is the line DoCmd.Maximize (so the report appears full size). What
happens is that my get parameters form goes to maximum before it disappears.
That does no harm, but esthetically, I'd like the form to have completely
gone invisible before the Maximize begins. Any suggestion?
 
G

Guest

I meant to say the button on the form makes the Getparameters form (not the
report) visible = false.
 
A

Allen Browne

Try moving the DoCmd.Maximize into the Activate event of the report. Can't
promise, but worth a try.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top