Solved Last selected item in a list box

Well, no idea, but I'm telling you, with what you asked me this morning, I think I have to say goodbye to the list boxes.
 
Since the listbox's listindex will be whatever was last selected, even on a multi select
Is this correct/true? I haven't used ListIndex yet, so was just curious. Thanks.

PS. For some reason, I had the impression ListIndex simply gives you the number/amount of selected items.
 
Is this correct/true? I haven't used ListIndex yet, so was just curious. Thanks
Yes.

PS. For some reason, I had the impression ListIndex simply gives you the number/amount of selected items.
No it gives the most recently selected index. I just tried it again to double confirm.
 
Yes.


No it gives the most recently selected index. I just tried it again to double confirm.
Excellent! Thanks for confirming that. Cheers!
 
There is more to it though. The OP plans to filters or at least remove items from the first list.
Besides, it gives me an error 5 when I remove items from the list box in the line
If I select item 9 and remove item 1 and 3 then that list index (9) is meaningless. It is now item 7.
If you unselect an item that is also the last index. The OP stated the last item selected which I assume is not the last item unselected.
So if you select 9 and 10 then unselect 10, I assume you want to show 9 hence the last "selected" not the last unslected.
 
Something like what you propose I had thought, but this morning, when I spoke with the person for whom I am doing the database, he told me that he needs a field to enter observations to each pattern. This almost discards the list boxes, and the best is a continuous form, with the Name, Description, Observation and Add fields
You still have to select more than one pattern. I assume the name, observation, and description is in a related table. So you can do a continuous form and have a FAYT combobox to pull the correct pattern. My understanding the list of patterns is over 100 so scrolling would be hard.

If you need something more advanced because the list is so long. You could have a button on the continuous form to pop up a search form. This could be sortable filterable listbox. Then you can find the pattern, select, close the popup, add your original form.
 

Users who are viewing this thread

Back
Top Bottom