Help needed in sorting report

  • Thread starter Thread starter Sunny
  • Start date Start date
S

Sunny

Hi All,

I am new in access. I have created query from client table which has
id,region,lastname,firstname,ssn fields and the query is sorted by region.

What I have done so far:
1. created report. set following properties for the report
recordsource = myquery
orderby on = Yes
2. Now in open event of form I am trying to set orderby property with
lastname, but report is not sorted by lastname.

I want this report sorted by region (which is sorted in query) plus lastname
(or ssn or firstname which I will set in open event). How do I do that?

Thanks.
 
Sunny said:
I am new in access. I have created query from client table which has
id,region,lastname,firstname,ssn fields and the query is sorted by region.

What I have done so far:
1. created report. set following properties for the report
recordsource = myquery
orderby on = Yes
2. Now in open event of form I am trying to set orderby property with
lastname, but report is not sorted by lastname.

I want this report sorted by region (which is sorted in query) plus lastname
(or ssn or firstname which I will set in open event). How do I do that?

The sort order in the query is ignored in all but the most
trivial reports. The OrderBy property is only a little more
useful.

The Sorting and Grouping window (View menu) is the way to
specify sorting that works for all reports. So clear the
OrderByOn property and forget setting the OrderBy property.

Now view the Sorting and Grouping window and select the
Region field in the first row. Select the LastName field in
the second row.

To change the field used by the second group level, use code
in the report's Open event:

Me.GroupLevel(1).ControlSource = "ssn"
 
Back
Top