List box navigate with button

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a list box and a NEXT button. How can I do to navigate (to illuminate)
the registers when pressing the NEXT button.
 
I'm not sure what you're asking, but if you want your button to change the
selection in a list box to the next item, you can use this code:

Private Sub cmdNext_Click()

lstMyListBox.SetFocus
If lstMyListBox.ListIndex = lstMyListBox.ListCount - 1 Then
lstMyListBox.ListIndex = 0
Else
lstMyListBox.ListIndex = lstMyListBox.ListIndex + 1
End If
End Sub
 
John,
This solved my problem and learned very.
Thanks for your help.
Jorge Barreto


"Jorge Barreto" escreveu:
 
Back
Top