Solved Perils Referring To A Value In Listbox By Referring To Listbox Itself (Not .SelectedItems)?

dalski

Member
Local time
Today, 01:56
Joined
Jan 5, 2025
Messages
240
Everywhere I have read says to use the .ItemsSelected property of a listbox to obtain the value. Looping through on multi-selections.

On a single selection listbox it seems that referencing the listbox itself will return the bound column value. Also if there is nothing selected it will return a null, & return a null if the listbox is empty. I would prefer to use this lean syntax if there are no negative effects I am ignorant of - so I ask a friendly expert; is it a bad idea to reference the listbox directly for it's value?
 
Everywhere I have read says to use the .ItemsSelected property of a listbox to obtain the value.
I cannot imagine that someone suggested using itemsselected for something other than a multiselect listbox. I have to imagine any search on the internet would say to reference the listbox value property for a standard single select listbox.

Although you can go through itemsselected on a single select, it would be cumbersome and a round about way.

The syntax on a single select would look like this using itemsselected
Me.List0.ItemData(Me.List0.ItemsSelected(0))
vs
normal method of
me.list0
 

Users who are viewing this thread

Back
Top Bottom