M Matizo Registered User. Local time Today, 02:56 Joined Oct 12, 2006 Messages 83 Dec 16, 2009 #1 Hi, How do I make a field on a form that shows (counts) the number of records selected on a list box? Thank You!
Hi, How do I make a field on a form that shows (counts) the number of records selected on a list box? Thank You!
John Big Booty AWF VIP Local time Today, 19:56 Joined Aug 29, 2005 Messages 8,262 Dec 16, 2009 #2 Add an unbound text box to your form an put the following in it's Control Source; Code: =[ListBoxName].[ListCount]
Add an unbound text box to your form an put the following in it's Control Source; Code: =[ListBoxName].[ListCount]
M Matizo Registered User. Local time Today, 02:56 Joined Oct 12, 2006 Messages 83 Dec 16, 2009 #3 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 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
John Big Booty AWF VIP Local time Today, 19:56 Joined Aug 29, 2005 Messages 8,262 Dec 16, 2009 #4 Sorry my bad Have a look at .ItemsSelected and .Count I've not tested this but try; Code: =[ListBoxName].[ItemsSelected].[Count]
Sorry my bad Have a look at .ItemsSelected and .Count I've not tested this but try; Code: =[ListBoxName].[ItemsSelected].[Count]
boblarson Smeghead Local time Today, 02:56 Joined Jan 12, 2001 Messages 32,059 Dec 16, 2009 #5 John Big Booty said: I've not tested this but try; Code: =[ListBoxName].[ItemsSelected].[Count] Click to expand... Yep, I tested and it works great.
John Big Booty said: I've not tested this but try; Code: =[ListBoxName].[ItemsSelected].[Count] Click to expand... Yep, I tested and it works great.
M Matizo Registered User. Local time Today, 02:56 Joined Oct 12, 2006 Messages 83 Dec 16, 2009 #6 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!
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!
boblarson Smeghead Local time Today, 02:56 Joined Jan 12, 2001 Messages 32,059 Dec 16, 2009 #7 I get an instant update using the control source binding method.