[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

summing a recordset

Posted on 1998-06-05
3
Medium Priority
?
264 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 100 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

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

650 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