Results 1 to 6 of 6

Thread: [RESOLVED] Expected Array Error

Threaded View

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Apr 2005
    Location
    Debug.Print
    Posts
    3,885

    Resolved [RESOLVED] Expected Array Error

    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:
    1. Private Sub Form_Load()
    2.     'declare some variables
    3.     Dim lngIndex As Long, lngTotal As Long
    4.    
    5.     'apply the page color scheme to the form
    6.     PageColorScheme Me
    7.    
    8.     'center the form
    9.     CenterForm Me
    10.    
    11.     'keep the form from going behind any others
    12.     KeepScreenOnTop = SetWindowLong(Me.hwnd, GWL_HWNDPARENT, frmControlPanel.hwnd)
    13.    
    14.     'populate some labels
    15.     'add the date to this label
    16.     lblDate(1).Caption = Date
    17.        
    18.     'add everything within subitems(8) and get
    19.     'a total and display that total in the
    20.     'lblTime label
    21.     For lngIndex = 1 To lvwTimeLog.ListItems.Count
    22.         lngTotal = lngTotal + lvwTimeLog(lngIndex).SubItems(8)
    23.     Next
    24.    
    25.     [hl]lblTime(1).Caption = Format(lngTotal(Time, "HH:NN"))[/hl]
    26. End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width