Solved Last selected item in a list box (1 Viewer)

zelarra821

Registered User.
Local time
Today, 11:10
Joined
Jan 14, 2019
Messages
803
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.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 03:10
Joined
Oct 29, 2018
Messages
21,358
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.
 

Isaac

Lifelong Learner
Local time
Today, 03:10
Joined
Mar 14, 2017
Messages
8,738
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.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 03:10
Joined
Oct 29, 2018
Messages
21,358
Yes.


No it gives the most recently selected index. I just tried it again to double confirm.
Excellent! Thanks for confirming that. Cheers!
 

MajP

You've got your good things, and you've got mine.
Local time
Today, 06:10
Joined
May 21, 2018
Messages
8,463
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.
 

MajP

You've got your good things, and you've got mine.
Local time
Today, 06:10
Joined
May 21, 2018
Messages
8,463
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.
 

zelarra821

Registered User.
Local time
Today, 11:10
Joined
Jan 14, 2019
Messages
803
Thank you guys very much for your responses.
 

Users who are viewing this thread

Top Bottom