Addressing listbox elements

exaccess

Registered User.
Local time
Today, 21:50
Joined
Apr 21, 2013
Messages
287
I have an unbound listbox with 3 columns. Call it PeopleBx. How can I address the item in the first row and first column. How can I address the first column in the selected row and how can I address the item in row 3 and column 2.
I tried with
Code:
Me.PeopleBx.Selected
and other possible variations but failed. Help please.
 
Bear in mind that if your listbox is set to 'multi select', to the uninitiated, it can be problematic as what you think looks like the selected row, the actual value returned is null and therefore any column information as well.
 
Thanks the column addressing is OK. But how can I find the row which is selected?
 
Ultimately, what are you trying to achieve?

Thanks the column addressing is OK. But how can I find the row which is selected?

Me.YourListBoxControl.ListIndex

The first row is 0.
 
Sorry for the late response but I was called in again for another urgent job. What I am trying to achieve is as follows: the user gets a csv formatted text file where there is a field containing names and other data such as dates, amounts, descriptions of objects bought or sold that is free text. Out of this text we have to extract names and some words of relevant information as phrases starting with certain standard words. So the idea is to minimize human intervention. Using some key phrases such as "From", "De", "Originated by" etc I can identify the relevant text info and the names are to be compared to a table. Now the point is to find an easy way to identify the useless words in the text and to eliminate them. So I decided to place the words which are not automatically eliminated into a listbox and let the user click on the ones to eliminate. That is why I need to identify the selected items.
 
Therefore, do you want to utilise a multi-select listbox? That is, selecting multiple items and then doing something with the selected items?
 
Therefore, do you want to utilise a multi-select listbox? That is, selecting multiple items and then doing something with the selected items?

Yes. If there is no other better way of doing it. Does this mean you are proposing to use javascript from within VBA? Do I need any change in the reference library for that?
 
You were silent on my post #3 so assumed this was not relevant when in fact it hit the nail on the head.

Javascript is not required.

I'm in Bali on holidays at the moment, will post relevant code snippet when I get home in a couple of days time (unless someone else chips in).
 
I prefer Macros and combo box. I would make it a combo box using Combo Box Wizard pointing to a table. Save for Review for Later Step 2: Open the Combo Box Properties, On Name Tab change name to CBO_you choice. Step 3 Go to Event Tab, On Change Property. Open Macro builder: Select Set Property Macro

Enter: Control Field: Your Field Name
Property: Value
Value: =[CBO_your Choice].column (1)
Add a another Set Property for each field and adjust the column (#)



Then make a
 
Thank you Gentlemen or Ladies as appropriate. During those days before Chrismas I am on multiple projects and not in a great hurry on this one for the moment. So I can wait for a response. But when I have time I'll have a go at the second solution. Many thanks. Now I have got some real trouble and have to open another thread.
 

Users who are viewing this thread

Back
Top Bottom