As stated, you can set the report's OrderBy while it is open, but you can
only use Report_Open to reassign the ControlSource of the GroupLevel.
So, to use the method in the webpage, the button on your form would need
to
close the report and reopen it, so Report_Open can pick up the new
setting
from your form:
Dim strDoc As String
strDoc = "Report1"
If IsLoaded(strDoc) Then
DoCmd.Close acReport, strDoc
DoCmd.OpenReport strDoc, acViewPreivew
End If
Dear Allen:
Thank you very much. I read this article already.
If by default, this report is sorted by ID.
In your case provided, which event or method or trigger the " case 1"
or
"case 2" so the report will be resorted. Take a look at the method you
provide, after the report is open, should another "Form" popup so the
user
can select another sorting method???
Thanks!!!
:
A report's sorting is determined by what is in its Sorting and
Grouping
box
(View menu.)
If there is nothing in that dialog, you can set the report's OrderBy
property after it is open, e.g.:
Reports!Report1.OrderBy = "CustLastName"
Reports!Report1.OrderByOn = True
It is also possible to programmatically change the order of the items
in
the
Sorting and Grouping box, by assigning the ControlSource of the
GroupLevel
in the Open event of the report. For an example, see:
Sorting Records in a Report at run-time
at:
http://allenbrowne.com/ser-33.html
Can Access have dynamic Sorting in Report?
I am after the first report is generated, can the user click at the
different field, so the report will be resorted???
If not, how can I use "Form" to achieve this goal???
EX: the report read:
ID CustFirstName CustLastName State.....
By default, the report sorts by ID, but if customer "select"(by
which
method?) State or CustFirstName or CustLastName, then the report
will
be
resorted!!!