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

slect a value in a listbox

Status
Not open for further replies.

kpetas

Programmer
Oct 19, 2006
11
ES
I want to put selected one value in cad ListBox,
It says me that I use incorrectly the ListIndex

I have this code:

For j = 0 To cad.ListCount
If cad.Column(1, j) = Me.Lista3.Column(0, 1) Then
cad.ListIndex = j
End If
Next
 
This is the Listbox rowsource

SELECT Kide.Codigokide, Kide.Nombrekide
FROM Kide ORDER BY [Codigokide];
 
You may try this:
For j = 0 To cad.ListCount - 1
If cad.Column(1, j) = Me.Lista3.Column(0, 1) Then
cad.SetFocus
cad.ListIndex = j
Exit For
End If
Next

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top