Need help

abz_y2k

Registered User.
Local time
Today, 12:27
Joined
Jul 30, 2007
Messages
66
Hi

I know someone must have answered this question but I searched everywhere can't seem to find it here.

1. I got 10 fields with different prices. all I want it to do is add them all up in another field called total but in FORMS ( so I guess might need VB coding)

2.also I got three fields, Total recharge, total cost and total profit. just want to do a simple calculation of Total Profit = total recharge - total cost but in vb if anyone can help

many thanks
 
1)
in your source for your unbound total field in the form...
=[Field1]+[Field2]+etc.

2)
Simular to above but use minus :)

Good luck...

P.S.
I sure hope you are not using spaces in your column names.... it is allowed but you really shouldnt use spaces or special characters in any names anytime anywhere (except in forms or reports when visible to the user)
 
Hi

Thanks for that help, it works fine but why doesnt it save the calculated sum in the field table
 
You have created an unbound control. It does not link to your table. Additionally, data bases are designed to store data and not calculations. Calculations should never be stored in table fields. You can obtain the information through queries. Don't confuse database tables with spreadsheets. They are not the same.
 
Oh ok, that aint no use to me cuz i will need to run reports to show like monthly profit etc.

how would you go about doing the calculations in queiries
 
For each calc you need. Add a field in your query and use the expression builder (look up in Access help) to do each of your calculations. If you are then running reports in Access, use your query as the source for your report. If you want to use Excel for your reports, then use your query as your source and export or use the Excel Analyze Wizard to get your information.
 

Users who are viewing this thread

Back
Top Bottom