listbox counting

  • Thread starter Thread starter JohnE
  • Start date Start date
J

JohnE

I have a listbox on a form. The users are asking to have
a small textbox below it indicating how many items are in
the listbox. This would be done each time there is a
change in the listbox. I realize this is simple but I am
not thinking clearly and not getting the items counted in
the listbox.
Any assistance is appreciated.
*** John
 
John,

Use the Before Update event of the listbox to fire the following line of
code:

Me.Text2 = Me.List0.ItemsSelected.Count

In the above, Text2 is assumend to be the name of the textbox displaying the
selection count, and List0 the name of the listbox control. Change to the
actual control names on your form.

HTH,
Nikos
 
Back
Top