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:
Dim itm2 As ListItem ListView2.View = lvwReport ListView2.ColumnHeaders.Add , , "Year" ListView2.ColumnHeaders.Add , , "Grade" Set itm2 = ListView2.ListItems.Add(, , "2004") itm2.SubItems(1) = "A"


Reply With Quote