Solved

summing a recordset

Posted on 1998-06-05
3
257 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
  • 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

ScreenConnect 6.0 Free Trial

At ScreenConnect, partner feedback doesn't fall on deaf ears. We collected partner suggestions off of their virtual wish list and transformed them into one game-changing release: ScreenConnect 6.0. Explore all of the extras and enhancements for yourself!

Question has a verified solution.

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

Suggested Solutions

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

810 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