Hi,
Please help.
I've have a listview that contails 10 columns. The records listed in the control change based on the month selected.
I now need to display a sub total at the end of the timespent column and dont have a clue how to do this...
I've searched all over the net and was only able to find this site which proves it is possible:
Please can someone assist with sample code
Please help.
I've have a listview that contails 10 columns. The records listed in the control change based on the month selected.
I now need to display a sub total at the end of the timespent column and dont have a clue how to do this...
I've searched all over the net and was only able to find this site which proves it is possible:
Please can someone assist with sample code
Code:
Private Sub LoadTimeSheetListView_Month()
Dim strSQL As String
Dim objCurrLI As ListItem
strSQL = "SELECT *" _
& " FROM TimeSheet WHERE username = '" & MainUser.Text & "' AND MonthNum = '" & txtMonthChange.Text & "'" _
& " ORDER BY Record"
mobjCmd.CommandText = strSQL
Set mobjRst = mobjCmd.Execute
ListViewGrid.ListItems.Clear
With mobjRst
Do Until .EOF
Set objCurrLI = ListViewGrid.ListItems.Add(, , !Record & "", , "Custs")
objCurrLI.SubItems(mlngREC_DATE_IDX) = !DATERECIEVED & ""
objCurrLI.SubItems(mlngREC_WEEK_IDX) = !Weekday & ""
objCurrLI.SubItems(mlngREC_USER_IDX) = !UserName & ""
objCurrLI.SubItems(mlngREC_PROJ_IDX) = !ProjectName & ""
objCurrLI.SubItems(mlngREC_AREA_IDX) = !FuncArea & ""
objCurrLI.SubItems(mlngREC_BUSI_IDX) = !Business & ""
objCurrLI.SubItems(mlngREC_HOUR_IDX) = !timespent & ""
objCurrLI.SubItems(mlngREC_DESK_IDX) = !Description & ""
objCurrLI.SubItems(mlngREC_WNUM_IDX) = !WeekNum & ""
objCurrLI.SubItems(mlngREC_MNUM_IDX) = !MonthNum & ""
objCurrLI.SubItems(mlngRCRD_ID_IDX) = CStr(!Record)
.MoveNext
Loop
End With
With ListViewGrid
If .ListItems.Count > 0 Then
Set .SelectedItem = .ListItems(1)
ListViewGrid_ItemClick .SelectedItem
End If
End With
Set objCurrLI = Nothing
Set mobjRst = Nothing
End Sub