I am getting the total of a column in listview and then adding that total to a label. I then want to format it in the format of ##:## and I am getting a "Expected Array" Error. This is my code. Please advise. The error happens on the highlighted part of the code.
VB Code:
Private Sub Form_Load() 'declare some variables Dim lngIndex As Long, lngTotal As Long 'apply the page color scheme to the form PageColorScheme Me 'center the form CenterForm Me 'keep the form from going behind any others KeepScreenOnTop = SetWindowLong(Me.hwnd, GWL_HWNDPARENT, frmControlPanel.hwnd) 'populate some labels 'add the date to this label lblDate(1).Caption = Date 'add everything within subitems(8) and get 'a total and display that total in the 'lblTime label For lngIndex = 1 To lvwTimeLog.ListItems.Count lngTotal = lngTotal + lvwTimeLog(lngIndex).SubItems(8) Next [hl]lblTime(1).Caption = Format(lngTotal(Time, "HH:NN"))[/hl] End Sub




Reply With Quote