list box selection - building string

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is it possible for Access to recognize the separate elements in a listbox
without them being selected?

Reason I ask...I would like to build a text string to be used as a query
criteria from multiple items in a list box, without having to highlight them.


This list box is set to value list, since I add items to it by double
clicking them in a separate list box.

I also have a button that runs a query based on the elements in the list
box. I would eventually like to display this crosstab query in yet another
list box.

Any suggestions?
 
Yes, the Column property of the listbox will let you get the value from any
row and column combination, whether or not that row is selected. The index
values for the Column property are zero based, so the first column is 0, the
second is 1, etc. This applies to the row numbers also.

Example:
The value in the 3rd column, 2nd row would be:
Me.lstMyListbox.Column(2,1)
 
Back
Top