Click to See Complete Forum and Search --> : ListView control. How do you extract\update values in report view


Michael Burke
August 18th, 1999, 03:29 PM
I have populated my ListView control with my values using DAO. I have 10 columns set up in report view. In my code fragment below, I am looking through my listview control searching for rows that the user has selected. Now I need to be able to extract some of the sub values and update others. How do I do this? Here is my code so far.

Private Sub SelectedCountCommand_Click()
Dim i As Integer

For i = 1 To ListView1.ListItems.Count
If ListView1.ListItems(i).Selected = True Then
'extract values from col 3 and 4 and subtract them

'update column 5 based on the results of col 3 minus col 4

End If
Next

End Sub

August 19th, 1999, 01:36 AM
access the SubItems array of the Listitem as in

dim item as listitem
set item = listview1.selecteditem
item.text refers to first column
item.subitems(1) refers to second column and so on

Michael Burke
August 19th, 1999, 11:23 AM
Thank, I wil try it