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!

How to target columns and rows in a list box 2

Status
Not open for further replies.

SmallTime

Technical User
May 17, 2004
127
0
0
GB
Hi,

I have a list box (LstNames) with 6 columns and variable number of rows. I’d want to target the 5th column of the current (selected) row.

I’ve read the help file and have spent the best part of the whole day trying various things without much luck.

Me.LstNames.column(4,?)

Any help or direction would be much appreciated.
 
Try:

[tt]Me.LstNames.Column(5, Me.LstNames.ItemsSelected(0))[/tt]

Assuming that this is not a multiselect listbox.
 
Hi Romeou,

You quite right, the list box isn't multi select.

I tried your suggestion but got a run-time error

"Runtime error 2480

You referred to a property by a numeric argument that isn’t one of the property numbers in the collection."

(Just for info, the count starts from 0)

Thanks for the admirable try Romeou.
 
How are ya SmallTime . . .

. . . and this:
Code:
[blue]   Me!LstNames.Column(4, Me!LstNames.[purple][b]ListIndex)[/b][/purple][/blue]

Calvin.gif
See Ya! . . . . . .
 
Why not simply this ?
Me!LstNames.Column(4)

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Hi all,

Thank you so much, both suggestions work perfectly

Aceman,
Sorry, neglected to mention I have column headings, but minor tinkering did the trick.
Me! LstNames.Column(4, (Me! LstNames.ListIndex) + 1)

PHV,
Beautiful. As always you have a way for simplifying things that I spend hours and hours over-complicating.

Kind regards
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top