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!

Multi Column Listboxes

Status
Not open for further replies.

PBAPaul

Programmer
Aug 3, 2002
140
GB
I have a list box that shows three columns from a database. The columns are 'Name', 'Grade' and 'Paid'.

If a user selects a value of 'Name', how do I get the values for 'Grade' & 'Paid' that are shown in the list box? Do I have to interrogate the database again using the value of 'Name' that has been selected? This is the way I have been doing it but ......

If anybody knows how to get these multi-column values striaght from the list box then I would be most grateful.

Paul
 
Hi Paul,

You can use something like Me.ListBoxName.Column(Column_No, Row_No). Off the top of my head I think column number is 1-based and row number 0-based.

Enjoy,
Tony
 
Hi Guys

You are almost there, it should be

Me!ListboxName.Column(1) will return 'Grade'
Me!ListboxName.Column(2) will return 'Paid'

Note: Column(0) returns the first column ie. 'Name'

Tony
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top