Hi
if i have a list box , i would like to show a dynamic label showing the number of the item is selected
regards
show the number of items selected in a list box ?
-
- BronzeLounger
- Posts: 1266
- Joined: 01 May 2016, 09:58
-
- Administrator
- Posts: 78620
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: show the number of items selected in a list box ?
Add the following to the After Update event procedure of the list box:
where SomeLabel is the name of the label and SomeListBox is the name of the list box.
Code: Select all
Me.SomeLabel.Caption = Me.SomeListBox.ItemsSelected.Count
Best wishes,
Hans
Hans
-
- BronzeLounger
- Posts: 1266
- Joined: 01 May 2016, 09:58
Re: show the number of items selected in a list box ?
thank you Hans,
if the lstbox is has some item selected on load the form , how to count this too please?
regards
if the lstbox is has some item selected on load the form , how to count this too please?
regards
-
- Administrator
- Posts: 78620
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: show the number of items selected in a list box ?
Use the same line in the On Load event of the form.
Best wishes,
Hans
Hans
-
- BronzeLounger
- Posts: 1266
- Joined: 01 May 2016, 09:58