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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Multi-Select 0
List Boxes 2
multi select list box if nothing selected 12
Combo Box / Query 7
Format list box contents 3
Copying List box values/selection to a database of sorts 2
List box 2
Access Cannot select items in listbox 1

Back
Top