Article ID: 182068
Article Last Modified on 11/18/2003
Index: 1 Text : Name Key : Name Index: 2 Text : Address Key : Address
Private Sub Command1_Click()
Dim itmX As ListItem
ListView1.View = 3 'report view
Set itmX = ListView1.ListItems.Add(1, "Bob", "Bob")
itmX.SubItems(ListView1.ColumnHeaders("Address").SubItemIndex) _
= "123 Main Street"
End Sub
BeginProperty ColumnHeader(2) {0713E8C7-850A-101B-AFC0-4210102A8DA7}
Key = "Address"
Object.Tag = ""
Text = "Address"
Object.Width = 2540
EndProperty
After adding the SubItemIndex line (use spaces to indent), it should
resemble:
BeginProperty ColumnHeader(2) {0713E8C7-850A-101B-AFC0-4210102A8DA7}
SubItemIndex = 1
Key = "Address"
Object.Tag = ""
Text = "Address"
Object.Width = 2540
EndProperty
NOTE: If there were more than 2 columns, you would do the same for any
additional column headers. For example, Column 3 would have a
SubItemIndex = 2.Additional query words: conversion
Keywords: kberrmsg kbbug KB182068