Solved

how can i count a column in a list box in access 2010

Posted on 2011-02-23
5
337 Views
Last Modified: 2012-05-11
i want to count a list box via a text box control source i tried this code:
=Count([ListRecurringPayments].[column](6))
but it's not working and it's return a error
0
Comment
Question by:bill201
  • 2
  • 2
5 Comments
 
LVL 75

Accepted Solution

by:
DatabaseMX (Joe Anderson - Access MVP) earned 250 total points
Comment Utility
This will give you the list count of the List box:

=[ListRecurringPayments].[ListCount]

I don't think you can directly get the count of a specific column ... say a True/False column ... and count the number of True's.

mx
0
 
LVL 3

Expert Comment

by:DockieBoy
Comment Utility
What are you trying to do here?  Count the number of items?  Get a total?  Count instances?
0
 

Author Comment

by:bill201
Comment Utility
ok it's not a problem i will make a dcount
0
 

Author Comment

by:bill201
Comment Utility
DockieBoy
i want to get a total
0
 
LVL 3

Assisted Solution

by:DockieBoy
DockieBoy earned 250 total points
Comment Utility
You could try this.
Dim MyTotal as Currency ' if you are totaling currency values'
For i =  0 to Me.ListRecurringPayments.ListCount - 1
 MyTotal = MyTotal + Me.ListRecurringPayments.Column(6, i)
Next i
 Me.MyTextBox = MyTotal

Put the code behind the on change event for the list box so that it will update your total if the list changes.
 
0

Featured Post

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Join & Write a Comment

In the article entitled Working with Objects – Part 1 (http://www.experts-exchange.com/Microsoft/Development/MS_Access/A_4942-Working-with-Objects-Part-1.html), you learned the basics of working with objects, properties, methods, and events. In Work…
Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now