Re: Report Orderby and Groupby in VB



RW wrote:

I have a report that needs to be grouped by the same field but sorted by
different fields. The group by field must be the last sorted field.

Report 1
Order by:
Field1
Field2
Field3
Field4
Field5 (also the GroupBy field)

Report 2
Order by:
Field9
Field10
Field5 (same field as 5 above and also grouped by)

In the vb, I assume I can use the following for Report 1:

Me.OrderBy = "Field1, Field 2, Field3, Field4, Field5" using actual field
names
Me.OrderByOn = True


and for report 2
Me.OrderBy ="Field9, Field10,Field5" again using actual field names
Me.OrderBy On = True

However, how do I Group by Field5? I have a header in the report for Field5.
If I remove this header, I lose the information in that section. This Group
by must be the last sort criteria.


The OrderBy property is overridden by the Sorting and
Grouping list. Put you sort fields in Sorting and Grouping
and you should get what you want.

--
Marsh
MVP [MS Access]
.



Relevant Pages

  • Re: Report Orderby and Groupby in VB
    ... setting the sorting and grouping using the S/G ... If you insist on using the OrderBy property, you should do it in the On Open ... Currently there isn't any sorting / grouping set on the report. ... Field5 ...
    (microsoft.public.access.reports)
  • Re: Report Orderby and Groupby in VB
    ... Currently there isn't any sorting / grouping set on the report. ... it seems that the OrderBy code isn't read. ... Field5 ...
    (microsoft.public.access.reports)
  • very new to crystal
    ... reports for the very first time. ... Unfortunately as is always the way, my first report would appear more ... Field4 ... Field5 ...
    (microsoft.public.vb.crystal)
  • RE: Ascending Order on report
    ... I never mess around with formatting data values in a query. ... I still don't know what your exact expressions are for sorting and grouping. ... The expression in my report is: ... "Duane Hookom" wrote: ...
    (microsoft.public.access.queries)
  • RE: Do Access Reports recalculate their record source?
    ... Reports ignore any sorting in a query, so a make table will not improve the ... Use the report Sorting and Grouping to order the report. ... Function JOB_INVENTORY(JOB As String, REF As Long, QTY As Long, CAP As Long) ...
    (microsoft.public.access.reports)