Hi!
I have a lsitbox which in turn stores logs. These logs can be added, amended and deleted. Works like a charm. But sometimes my users want to delete the logs and they click one time to many... Which in turn results in that there is no selecteditem, and hence no index which give me an error. This is all understandable BUT how can I check the listview1.selecteditem.index for not having an item selected?!
This give me an error, the index is never 0.
I also tried with: ListView2.SelectedItem.Index = vbnullstring,
I did not work either also tried with NULL but same as before does not work, this is my code.
I have a lsitbox which in turn stores logs. These logs can be added, amended and deleted. Works like a charm. But sometimes my users want to delete the logs and they click one time to many... Which in turn results in that there is no selecteditem, and hence no index which give me an error. This is all understandable BUT how can I check the listview1.selecteditem.index for not having an item selected?!
This give me an error, the index is never 0.
I also tried with: ListView2.SelectedItem.Index = vbnullstring,
I did not work either also tried with NULL but same as before does not work, this is my code.
Code:
With UserForm1.ListView2
If ListView2.SelectedItem.Index = 0 Then
MsgBox ("You have tried to delete a log that is NOT there!")
Else
logg = ListView2.SelectedItem.Index
End If