I have a listview in a userform and want to be able to double click on the event and populate the data in both caption and value fields.
I am struggling with the code. This is one of the items that it supposed to work, but doesn't seem to be doing so.
I am struggling with the code. This is one of the items that it supposed to work, but doesn't seem to be doing so.
VBA Code:
Private Sub ListView1_DblClick
Dim TheSelectedItem As ListItem
If Me.ListView1.SelectedItems.Count > 0 Then
TheSelectedItem = Me.ListView1.SelectedItems(0)
Me.TextBox1.Text = TheSelectedItem.Text
Me.TextBox2.Text = TheSelectedItem.SubItems(0).Text
Me.TextBox3.Text = TheSelectedItem.SubItems(1).Text
End If
End Sub