By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,790 Members | 1,409 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,790 IT Pros & Developers. It's quick & easy.

Selecting in a Listbox an Unbound column

P: n/a
I can easily select a row in a listbox with:
Me.lstMyListBox = "Some Data"
if "Some Data" is in a record in the bound column.

Is there any way to select a record based on a column other than the bound
column?

Me.lstMyListBox.Column(1) = "Other Data"
gets an error.

Nov 12 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Sure, you can do it, but you have to write code to search for the item
yourself. Once yo find the row that has the data, you can read the bound
column data from the row, and assign the value to that data to select the
row. The .Column property allows either one parameter for just the column
or 2 parameters for both the column and row numbers. The .ListCount
property tells you how many rows, and the row numbers go from zero to
..ListCount-1.

Note that, if the list or combo box has column headers, the row count
includes the header row, and the data returned from row zero is the column
header caption text.

On Wed, 01 Oct 2003 06:12:25 GMT, "Randy Harris" <ra***@SpamFree.com>
wrote:
I can easily select a row in a listbox with:
Me.lstMyListBox = "Some Data"
if "Some Data" is in a record in the bound column.

Is there any way to select a record based on a column other than the bound
column?

Me.lstMyListBox.Column(1) = "Other Data"
gets an error.


Nov 12 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.