If you want to highlight the first entry you would use:
Me!YourListBox.Selected(0) = True
You would increment the 0 by 1 for the next entry and so on. If you are not sure where the entry will be, but you know what it will say then you can use the following:
Dim intRow As Integer
For intRow = 0 to Me!YourListBox.ListCount - 1
If Me!YourListBox.Column(0, intRow) = "Whatever" Then
Me!YourListBox.Selected(intRow) = True
Exit For
End If
Next intRow
I appreciate the input. I'm using the following line...
Me!YourListBox.Selected(x) = True
This highlights great, but when I try to arrow down on the listbox, the focus begins with the first entry. How can I set the focus mid-way in a listbox? -illini
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.