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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB 6 to Crystal 8 sort field

Status
Not open for further replies.

vatrix

Programmer
Apr 15, 2001
3
US
How do I tell the report what sort fields to use from my VB Code. I have used replaceselectionformulas in VB before but this must be REAl easy??!!, I can't get it. Thanks
 
hello

If you want to change the sorts, then you use the SortFields property. This will only sort the detail records within any existing groups. The groups won't change. Is this what you are looking for?

hope this helps E. McEvoy
Crystal Reports Consultant
 
Thanks, I must be close to solving this. In my VB code I have wrtten...

CrystalReport1.ReportFileName = "c:\web\skiinst\client1.rpt"

CrystalReport1.SortFields =

What do I place after the SortFields property?

Thanks again
Vatrix
 
Thanks...I finnaly got it. Here is the code for others with the same roblem. It was to easy..

Dim SortStuff As String

'SortStuff = "Client.InstName"
SortStuff = "Client.LessonDate"

CrystalReport1.ReportFileName = "c:\web\skiinst\client1.rpt"
'CrystalReport1.ReplaceSelectionFormul SortStuff
CrystalReport1.SortFields(0) = "+" & "{" & SortStuff & "}"

CrystalReport1.Action = 1

End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top