How do I know which item in the Microsoft Access selection list was selected?

I have a list in the form of Microsoft Access. The MultiSelect property is set to simple.

I want to know which item in the list was clicked. Keep in mind that an item can be clicked to select or SELECT an item.

Is there an easy way to do this? If not, is this a tricky way to do this?

I tried using the SendMessage window API, but not the banana, because the access controls do not support the hwnd property.

Set

+3
source share
1 answer

If the MultiSelect proxy is None, then just the value of the list box.

Debug.Print Me.List16

should be enough.

If you need multiple column values

Debug.Print Me.List16.Column(0) & ", " & Me.List16.Column(1)

MultiSelect , ItemsSelected.

Dim varItm As Variant

For Each varItm In me.ListBx.ItemsSelected
    Debug.Print me.ListBox.ItemData(varItm)
Next varItm

.

+4

Source: https://habr.com/ru/post/1724700/


All Articles