Computing.Net > Forums > Programming > VB6 & Access Calculations

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Click here to start participating now! Also, check out the New User Guide.

VB6 & Access Calculations

Reply to Message Icon

Name: Mark Long
Date: July 5, 2004 at 18:52:29 Pacific
OS: Win 98
CPU/Ram: 300/512
Comment:

I have a table in an Access database. Two of the columns contain the data I wish to calculate (Cost * Quantity)= X, this has to apply to each record. Once I have the value X it then needs to be added to the value of X in the next record and so on until the last record is reached. The new value Y ( Sum of Xs) is what I am after to display in a textbox on a form. I have never done calculations using VB and require an example of how I could achieve this.

I have used data control for the form & table and an example of the code I would use to define say Cost would be:

datTable.Recordset.Fields("Cost")

so this would need to be multiplied by

datTable.Recordset.Fields("Quantity")

and all

While Not datTable.Recordset.EOF

Could someone please show me how to juggle this little lot so I can display the total value of all the products in the table to the textbox on the form.

Regards

M



Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


what differs between c++ ... javascript problem



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: VB6 & Access Calculations

VB6 and Access 2000 www.computing.net/answers/programming/vb6-and-access-2000/10084.html

How to connect VB6 with Access www.computing.net/answers/programming/how-to-connect-vb6-with-access/8818.html

VB6 to Access www.computing.net/answers/programming/vb6-to-access/12087.html