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

Refer to second column in listbox

Status
Not open for further replies.

Chew407

Technical User
Mar 28, 2005
92
CA
Good morning,

I have a listbox on a form that when double clicked, puts the value of the bound column of that particular record into a textbox. What I want to know is how, or is it even possible to put the value of the second column into another textbox?

For example...

Me.txtName.Value = Me.EmployeeList.Value
Me.txtDepartment.Value = Me.EmployeeList.Column?2?.Value

I could probably make a second list box and refer to it's unique name (Me.EmployeeDepartment) but I's still like to know if this is possible. Any help you can offer is much appreciated.

Chew
 
Chew,

The Column property is zero-relative, so try this to get column 2:
Code:
Me.txtDepartment.Value = Me.EmployeeList.Column(1).Value

Si hoc legere scis, nimis eruditionis habes
 
Thanks a lot Kramer.

Me.txtDepartment.Value = Me.EmployeeList.Column(1).Value
produces a run-time error - object required. I took the value off the end and it worked fine. Thanks so much.

How's the coffee table book coming along?

Regards,

Chew
 
Not as good as Movie Phone.....

Si hoc legere scis, nimis eruditionis habes
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top