ellebanna
04-19-2004, 12:55 PM
I am able to change the group field at runtime but the Running totals are not reflecting the change, how do you do this?
Code to change the group field:
Sub ChangeGroup(ActualSort, SortOrder, Xviewer)
Dim Fld, CountFld As Integer
Dim S As String
CountFld = CRReport.RecordSortFields.Count
For Each SortField In CRReport.RecordSortFields
If ActualSort = SortField.Field.Name Then
Set NewSortfld = SortField
Set SortField = CRReport.RecordSortFields(1)
SortField.Field = NewSortfld.Field
CRReport.Areas.Item("GH").GroupConditionField = SortField.Field
If SortOrder = "Ascending" Then
CRReport.Areas.Item("GH").SortDirection = crAscendingOrder
Else
CRReport.Areas.Item("GH").SortDirection = crDescendingOrder
End If
Exit For
End If
Next
Xviewer.ViewReport
End Sub
Code to change the group field:
Sub ChangeGroup(ActualSort, SortOrder, Xviewer)
Dim Fld, CountFld As Integer
Dim S As String
CountFld = CRReport.RecordSortFields.Count
For Each SortField In CRReport.RecordSortFields
If ActualSort = SortField.Field.Name Then
Set NewSortfld = SortField
Set SortField = CRReport.RecordSortFields(1)
SortField.Field = NewSortfld.Field
CRReport.Areas.Item("GH").GroupConditionField = SortField.Field
If SortOrder = "Ascending" Then
CRReport.Areas.Item("GH").SortDirection = crAscendingOrder
Else
CRReport.Areas.Item("GH").SortDirection = crDescendingOrder
End If
Exit For
End If
Next
Xviewer.ViewReport
End Sub