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

How to change rows in List box

Status
Not open for further replies.

HebieBug

Programmer
Jan 8, 2001
354
JP
Have a listbox called List0.
When user pushes a command button say Cmd_Change then would like the list box to become the focus (no problem yet).
Would like a alocated row to be highlighted within the list box.
Say the alocated number is 60 every time. The row that should be selected is row 60 not the primary key number 60 (taken from the listIndex)
Anyone with some ideas.. Please remeber though that is as if you counted through the list box to the 60 row of the list box and then highlighted it.
 
The Access controls are great in a lot of ways but they don't give you some of the programming flexibility that VB does. Here's a quick hack that works--you'll have to hard code a value for the selection (rather than a more generic row #). Make sure that the bound column is the one that has the value that you want to go to:
[tt]
Private Sub Command105_Click()

With List103

.SetFocus
.Value = "myValue"
End With

End Sub
[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top