Solved

summing a recordset

Posted on 1998-06-05
3
261 Views
Last Modified: 2010-05-03
i have a recordset created by a sql statement., the recordset is assigned to a datacontrol
i am trying to find a way to move throught the recordset and sum one of the fields.
i triedthe following code but nothing happen
datcheck.recordset.movefirst
while not datcheck.recordset.eof
 total = total + amt
  datcheck.recordset.movenext
wend
this worked for the date field... but i want the amt field
any suggestions
0
Comment
Question by:csm
[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
3 Comments
 
LVL 6

Accepted Solution

by:
clifABB earned 50 total points
ID: 1462658
total = total + datcheck.recordset.fields("amt")
0
 

Expert Comment

by:entretec
ID: 1462659
Why not create a SUM query for the field you wish to add up?

Use Access to create the SUM create and call this for your DAO recordset

MikeB
0
 
LVL 6

Expert Comment

by:clifABB
ID: 1462660
entretec:
What a grand idea.  Normally I would have done it that way.  I guess I was just basing my answer on the example csm gave.

csm:
Maybe you should reject my answer and allow entretec to answer (with an example).
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

729 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