Count field

Matizo

Registered User.
Local time
Today, 02:56
Joined
Oct 12, 2006
Messages
83
Hi,

How do I make a field on a form that shows (counts) the number of records selected on a list box?

Thank You!:o
 
Add an unbound text box to your form an put the following in it's Control Source;
Code:
=[ListBoxName].[ListCount]
 
Hi John,

Thanks for that. How do I change it so that it shows not the number of all employees in the list box but only the number of selected employees? (This is multiselection listbox).


Cheers
 
Hi,

yes it works for me too :)

However, I figured out that it will be better to use it as a code:

Code:
Private Sub lstEmployees_AfterUpdate()

   Me.txtCount = Me.lstEmployees.ItemsSelected.Count
 
End Sub

This way I get instant update whenever I select/unselect a record in the box :)

Cheers!
 
I get an instant update using the control source binding method.
 

Users who are viewing this thread

Back
Top Bottom