B
Bret
This discussion group provided the code below that works wonderfully.
It takes a number from a text box that user has entered, searches for that
number in the first column of the listbox and then Selects it.
The problem is the Listbox has about 300 records so, if for example the
found record is the 200th record, user has to use the Vertical Scroll bar to
see the selected record. I've tried .requery, .repaint, .setFocus and haven't
found a way for the listbox to scrolldown to the selected records so user
doesn't have to.
Please can this be done programatically.
thanks.
With Me.Listbox
If .ListCount > 0 Then
'.Selected(0) = True
For i = 0 To .ListCount - 1
If .Column(0, i) Like strSearchNumber Then
.Selected(i) = True
End If
Next i
End If
End With
It takes a number from a text box that user has entered, searches for that
number in the first column of the listbox and then Selects it.
The problem is the Listbox has about 300 records so, if for example the
found record is the 200th record, user has to use the Vertical Scroll bar to
see the selected record. I've tried .requery, .repaint, .setFocus and haven't
found a way for the listbox to scrolldown to the selected records so user
doesn't have to.
Please can this be done programatically.
thanks.
With Me.Listbox
If .ListCount > 0 Then
'.Selected(0) = True
For i = 0 To .ListCount - 1
If .Column(0, i) Like strSearchNumber Then
.Selected(i) = True
End If
Next i
End If
End With