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

ListBox Auto Row Selection 1

Status
Not open for further replies.

Cyberjake

Technical User
Joined
Jun 5, 2003
Messages
14
Location
US
I have a need to automatically select the first row of a list box. Is there a way to automatically select the first row of the list box when the list box gets focus? The user uses the first row in the list box 95% of the time and would like to have it automatically selected when they tab into the list box.

Thanks,
 
This works in vb 6 ... it should be the same in access

on the gotfocus event of the list box put the line
list1.listindex = 0

as 0 should be the index of the first item

Private Sub List1_GotFocus()
List1.ListIndex = 0
End Sub

Transcend
[gorgeous]
 
That was it...Thanks a million. I have to say that I have only begun to use this site and already it has proven to be more helpful than I could have ever dreamed. I look forward to utilizing this site in the future.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top