Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

wayward listbox

Status
Not open for further replies.

striker73

MIS
Jun 7, 2001
376
US
I have a listbox on my form that displays a series of data from a query. After I set the rowsource in VBA, I want to select the first item in the list and display it highlighted to the user. My code is as follows:

lstAnalyticals = lstAnalyticals.ItemData(0)
lstAnalyticals_Click


On the click event, I take all of the fields in the listbox and display them in textboxes on my form, this way I can click different entries and display the information.

When the form loads, the appropriate entries load in the textboxes, but the first entry in the listbox doesn't appear to be selected (none of them do). When I click on listbox, the entries are highlighted.

Is there anyway to make the entry in the listbox highlighted using VBA? Thanks!
 
I tried that and it didn't seem to work, but then I tried: lst Analyticals.Selected(1) and that worked fine. Thanks!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top