Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sort Group descending from VB

Status
Not open for further replies.

andrewwatson

Programmer
Jul 16, 2002
10
GB
I've got a report (CR 4.6) that I'm controlling from VB(6) using crystl32.ocx. I want to control the grouping depending on parameters entered in the VB program.

I've been able to change the groups using formulae, but can't figure out how to get them sorted in descending order.

Groups are @Group1, @Group2

From VB, I change the fields being grouped on by using:
rpt.Formulas(0)="Group1 = {Query.Name}" etc

For the sort order, I've tried:
rpt.GroupSortFields(0)="-{@Group1}"
and
rpt.GroupSortFields(0)="-GroupName({@Group1})
and
rpt.GroupSortFields(0)="-{Query.Name}

all of these give the error "Invalid Field Name"

Any help would be greatly appreciated.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top