Results 1 to 3 of 3

Thread: [RESOLVED] Index out of Bounds

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Dec 2011
    Posts
    675

    Resolved [RESOLVED] Index out of Bounds

    Hi

    In the below code it is giving me error on this line
    If lvwreturn.ListItems(intcount).Checked = True Then

    There are 2 records in ListView

    For intcount = 0 To lvwreturn.ListItems.Count - 1
    If lvwreturn.ListItems(intcount).Checked = True Then
    MsgBox lvwreturn.ListItems(intcount).SubItems(1)

    End If
    Next intcount

    Thanks

  2. #2
    Frenzied Member
    Join Date
    Jun 2014
    Posts
    1,084

    Re: Index out of Bounds

    For intcount = 1 To lvwreturn.ListItems.Count ???

  3. #3
    PowerPoster SamOscarBrown's Avatar
    Join Date
    Aug 2012
    Location
    NC, USA
    Posts
    7,442

    Re: [RESOLVED] Index out of Bounds

    or

    Code:
    Dim lvwItem As ListItem
       For Each lvwItem In lvwreturn.ListItems
          MsgBox lvwItem.Text
       Next lvwItem

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