For this to work, you need to have ListView1.MultiSelect = False.
'// btnPrevious.
If Not ListView1.SelectedItems.Count = 0 Then '// check if item is selected.
With ListView1.SelectedItems(0)
If Not .Index = 0 Then '// if not current index ='s the first item.
ListView1.Items(.Index - 1).Selected = True '// select previous item.
ListView1.Items(.Index - 1).EnsureVisible() '// make sure selected item is visible if ListView has vertical scrollbar.
navigaterecords(.Index - 1) '// get records for previous item.
Else
MsgBox("Index at Start of records.")
End If
End With
End If
'// btnNext.
If Not ListView1.SelectedItems.Count = 0 Then '// check if item is selected.
With ListView1.SelectedItems(0)
If Not .Index = ListView1.Items.Count - 1 Then '// if not current index ='s the last item.
ListView1.Items(.Index + 1).Selected = True '// select next item.
ListView1.Items(.Index + 1).EnsureVisible() '// make sure selected item is visible if ListView has vertical scrollbar.
navigaterecords(.Index + 1) '// get records for next item.
Else
MsgBox("Index at End of records.")
End If
End With
End If
If .MultiSelect is a necessity, you can always toggle it to False just before running the code in each Button and set it back to True when done.
ListView1.MultiSelect = False
'// code here for Previous/Next.
ListView1.MultiSelect = True