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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Listbox list item not highlighting on open

Status
Not open for further replies.

JMal

Programmer
Aug 19, 2004
61
IE
I have a listbox called "list_Name" in a form which displays images. The listbox is used to select different images which works fine.

The one thing I cannot get working is when the form opens, I want the first item in the listbox highlighted.

At the moment I have to click to first record to highlight it.

Can this be do when the form opens.
 
Code:
Private Sub Form_Open(Cancel As Integer)
    Me.list_Name.Selected(0) = True
End Sub


________________________________________________________
Zameer Abdulla
Help to find Missing people
My father was a realistic father; not a vending machine dispense everything I demanded for!!
 
This code selects the first row of the list box as required, but lock the listbox form can other changes.

I there a way of preventing the locking effect form the above code?
 
Spoke too soon. It works perfect in the "On Load" event ofr the form.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top