listbox counting

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
 
N

Nikos Yannacopoulos

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top