My list is sorted in ascending value. It is populated via sqlstr in vba that pulls down each row in a table, then sorts them in ascending value order. The list can be 'added to' with values collected from several text boxes that are then inserted into a table and the list requeried.
I want to find the find the last record in a table, then move to that record in the sorted list and 'select' it.
This appears to work. The row with the values is identified and 'selected', but when I test the value of the bound column it is null.
I want to find the find the last record in a table, then move to that record in the sorted list and 'select' it.
This appears to work. The row with the values is identified and 'selected', but when I test the value of the bound column it is null.
Code:
Dim lastPlaceID As Integer
lastPlaceID = DMax("PrizeSlidingScalePlacesID", "tblPrizeSlidingScalePlaces")
' or = DMax("IDField","YourTable","WhenField=Value")
Dim i As Integer
For i = 0 To Me.List35.ListCount - 1
If Me.List35.ItemData(i) = "" & lastPlaceID Then
Me.List35.Selected(i) = True
End If
Next