1. Either there is not exact match on item.Text & lblEmpNo.Text or SubItem2 is not ""
Have you stepped through the code with the debugger to see if your line inside the if block is being executed?
Here's a simple way of seeing if that is being done.
For Each item As ListViewItem In ListView1.Items
If item.Text = lblempno.Text And item.SubItems(2).Text = "" Then
MessageBox.Show("I found the item") 'Remove this when testing is done.
item.SubItems(2).Text = lbltime.Text
End If
Next
Now when you run the code, if you don't get the messagebox then one of your checks isn't true and it's skipping over the setting of Item.SubItems(2).Text.

New Topic/Question
Reply





MultiQuote




|