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

Select specific row matching specifications from listbox

Status
Not open for further replies.

andyukcy

Technical User
Jul 9, 2003
64
0
0
I have a listbox showing the payments of customers in each of the customer form.

For each payment there is a "reason".I want to get the last payment's reason. If the reason is anything else BUT monthly payment, i would like to go to the second row until it finds a "monthly payment". The value of the payment id is then stored in a text box.

I have tried
If statements with ListIndex properties, but it does not automatically move to the next line.

can you help?
 
a rather nasty way of doing this, but if this is the only way then you could just loop through the listbox using a counter of some sort...

for idx = 1 to lbx.listcount-1
counter = idx

if blah <> blah then
do while blah <> blah
counter = counter + 1
loop

set whatever = whatever...
endif
next idx

something like that will work, but you will have to mess around with the code a little...

--------------------
Procrastinate Now!
 
How are ya andyukcy . . .

Be more specific about going to the 2nd record.

Calvin.gif
See Ya! . . . . . .
 
Hello I have tried the following code. No success. Any Ideas? I want to find from my List Box a row with a value "September".

Dim idx As Integer
Dim counter As Integer
For idx = 1 To Me.List605.ListCount - 1
counter = idx

If Me.List605.Value <> September Then
Do While Me.List605.Value = September
counter = counter + 1
Loop

Me.Text659.Value = Me.List605.Value
End If
Next idx

Thanks...
 
Have a look at the Column property of the ListBox object.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
That was very helpfull. Though if you see my Loop I choose the value in List Box which is been taken from a specific column by using the Bound Column property. And my purpose is to do the Loop without selections on the List Box. For Example in the Got Focus Event.

Thanks..
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top