i have developed a vb6 program that displays reports using the listview
am able to generate the grand totals but would like to calculate both the group subtotals and the grand total.please bail me out quick

this is my code
If rsstarpof.State <> adStateClosed Then rsstarpof.Close
SearchSQLString488 = "SELECT * FROM Payments WHERE datez >= #" & Format(DTPicker1.Value, "MM/dd/yyyy") & "# AND datez <= #" & Format(DTPicker2.Value, "MM/dd/yyyy") & "# AND Mode like'" & Text2.Text & "' GROUP BY Agent"
With rsstarpof
.Open SearchSQLString488, conrepo, adOpenStatic, adLockReadOnly
If rsstarpof.RecordCount = 0 Then
frmReports.lstReports.ListItems.Clear
frmReports.lstReports.ForeColor = vbRed
Set lvst = frmReports.lstReports.ListItems.Add(, , "No")
lvst.SubItems(1) = "record "
lvst.SubItems(2) = "Match"
lvst.SubItems(3) = "Found"
lvst.SubItems(4) = "Try"
lvst.SubItems(5) = "Again"
frmReports.lstReports.Gridlines = False
frmReports.lstReports.Enabled = False
Else

frmReports.lstReports.Enabled = True
frmReports.lstReports.ForeColor = vbBlue
frmReports.lstReports.Gridlines = True
frmReports.lstReports.ListItems.Clear
Do While Not .EOF
Set lvst = frmReports.lstReports.ListItems.Add(, , Format(!datez, "dd/MM/yyyy"))
frmReports.lstReports.ColumnHeaders(1).Text = "DATE"
frmReports.lstReports.ColumnHeaders(2).Text = "DXCN"
frmReports.lstReports.ColumnHeaders(3).Text = "NAMES"
frmReports.lstReports.ColumnHeaders(4).Text = "MODE"
frmReports.lstReports.ColumnHeaders(5).Text = "ANS"
frmReports.lstReports.ColumnHeaders(6).Text = "CONTACT"
frmReports.lstReports.ColumnHeaders(7).Text = "AGENT NAME"
frmReports.lstReports.ColumnHeaders(8).Text = "PAYING AGENT"
frmReports.lstReports.ColumnHeaders(9).Text = "KSH"
frmReports.lstReports.ColumnHeaders(10).Text = "US$"
frmReports.lstReports.ColumnHeaders(9).Alignment = lvstColumnRight
frmReports.lstReports.ColumnHeaders(10).Alignment = lvstColumnRight
lvst.SubItems(1) = !DXCN
lvst.SubItems(2) = !Namess
lvst.SubItems(3) = !Mode
lvst.SubItems(4) = !Ans
lvst.SubItems(5) = !Contact
lvst.SubItems(6) = !Agent
lvst.SubItems(7) = !Payagent
lvst.SubItems(8) = Format(!ksh, "###,##0.00")
lvst.SubItems(9) = Format(!Usdollars, "###,##0.00")
.MoveNext
Loop
End If
End With
'Set rsstarpo = Nothing
Dim dblTotal As Double
Dim dbldollar As Double
Dim mItem8 As ListItem
Dim j8 As Single
For j8 = 1 To Me.lstReports.ListItems.Count
'Calculation total of all Items in the Order
dblTotal = dblTotal + CDbl(Me.lstReports.ListItems(j8).SubItems(8))
dbldollar = dbldollar + CDbl(Me.lstReports.ListItems(j8).SubItems(9))

Next j8
With Me.lstReports.ListItems
'Add an Empty row
Set mItem8 = .Add()
mItem8.SubItems(7) = " "
mItem8.SubItems(8) = " "
mItem8.SubItems(9) = " "
'Add the total row
Set mItem8 = .Add()
mItem8.SubItems(7) = " Totals:"
mItem8.SubItems(8) = Format(dblTotal, "###,##0.00")
mItem8.SubItems(9) = Format(dbldollar, "###,##0.00")

End With

thank you