Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2011-02-23
5
Medium Priority
?
384 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 75

Accepted Solution

by:
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform) earned 1000 total points
ID: 34967518
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
ID: 34968696
What are you trying to do here?  Count the number of items?  Get a total?  Count instances?
0
 

Author Comment

by:bill201
ID: 34969099
ok it's not a problem i will make a dcount
0
 

Author Comment

by:bill201
ID: 34969109
DockieBoy
i want to get a total
0
 
LVL 3

Assisted Solution

by:DockieBoy
DockieBoy earned 1000 total points
ID: 34972685
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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …

636 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