Results 1 to 2 of 2

Thread: Trouble Adding Second ListView Control

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Dec 2005
    Posts
    113

    Trouble Adding Second ListView Control

    Below is some example code I am using. I have changed "itm" to "itm2" (and declared the variable) and "ListView1" to "ListView2" to try and add a second ListView control however it keeps giving an error on "Set itm2 = ListView2.ListItems.Add(, , "2004")" (Type Mismatch)

    The code is adding 2004 to the listview but then causing the error. I have spent a while trying to figure out what's going on but have got nowhere.

    Anyone have any suggestions?

    VB Code:
    1. Dim itm2 As ListItem
    2.  
    3. ListView2.View = lvwReport
    4.  
    5. ListView2.ColumnHeaders.Add , , "Year"
    6. ListView2.ColumnHeaders.Add , , "Grade"
    7.  
    8. Set itm2 = ListView2.ListItems.Add(, , "2004")
    9. itm2.SubItems(1) = "A"

  2. #2

    Thread Starter
    Lively Member
    Join Date
    Dec 2005
    Posts
    113

    Re: Trouble Adding Second ListView Control

    Wrong forum, moderators please delete.

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