Form Autosum (1 Viewer)

shehzadarshad2000

New member
Local time
Today, 22:23
Joined
Nov 9, 2009
Messages
3
i have make a simple access 2003 databse with three field

this datbase about our showroom sale
cash sale
credit card sales
cheques sales

Total .

i want to do form should do auto total in Total box of form please tell me how is that posible thanks if some one want me to send database in email i could thanks . Shehzad From UAE (Abu Dhabi) know as Dubai
 

w1fini

Registered User.
Local time
Tomorrow, 02:23
Joined
Nov 4, 2009
Messages
19
Hi,

It depends on what you want to do with your value. Do you just want to show it in the form or do you want to save it into your database (what would be a bad design issue).

In the first case, make a new textbox. Click on properties and go to data-->controlsource. Here you type the names of your fieldcontrols in the following form:
Code:
= [cash sale] + [credit card sales] + [cheques sales]
!!!Make sure you set the Format of your 3 controls to a number(that will ease any calculation operations)

If you now want to save this value back into your database(what as I mentioned is an error by design) then you can connect this value to a tablefield.
 

shehzadarshad2000

New member
Local time
Today, 22:23
Joined
Nov 9, 2009
Messages
3
Thanks for you reply dear ? i am really new with access but trying to make a nice one yes i have to save also in my tables the grand total should be saved in tables also in the databse also , i will try to do it and will let you know thanks for you reply take care bye bye
 

Rabbie

Super Moderator
Local time
Today, 19:23
Joined
Jul 10, 2007
Messages
5,906
Thanks for you reply dear ? i am really new with access but trying to make a nice one yes i have to save also in my tables the grand total should be saved in tables also in the databse also , i will try to do it and will let you know thanks for you reply take care bye bye
As a general rule calculated values like Grand Total should not be stored in tables. These values should be calculated in queries or on the form when they are needed. This ensures that they are up-to-date and accurate.
 

Rich

Registered User.
Local time
Today, 19:23
Joined
Aug 26, 2008
Messages
2,898
You should also read up on normalising your db, you don't need three separate fields for sales
 

shehzadarshad2000

New member
Local time
Today, 22:23
Joined
Nov 9, 2009
Messages
3
ok thanks its working now my form is calculating numbers and doing autosum but only problem now its just saving Cash Sale , credit card sale, Cheque sale in the table fields but not saving Total amount in the Table field please let me know if someone could help in this regards thanks
 

boblarson

Smeghead
Local time
Today, 11:23
Joined
Jan 12, 2001
Messages
32,059
...but not saving Total amount in the Table field please let me know if someone could help in this regards thanks

Rabbie already gave you the answer to that:

Rabbie said:
As a general rule calculated values like Grand Total should not be stored in tables. These values should be calculated in queries or on the form when they are needed. This ensures that they are up-to-date and accurate.

So, the answer is YOU DO NOT STORE THE TOTALS. You calculate them using a query when you need them. And just so you know, you can use a query in about 99.9% of the places you can use a table.
 

Rich

Registered User.
Local time
Today, 19:23
Joined
Aug 26, 2008
Messages
2,898
How odd that it's obvious you're using a spreadsheet approach in Access, what happens if you want to add another payment method, using your method you'll have to add extra fields to the table. You only need two fields one to record sales and one to record the payment method, if the payment method is stored in a lookup table you can add as many methods as you want simply by adding extra records to the lookup table. Having just one field to record actual transactions means that you'll only have to Sum One field, not three, four, five, etc.
 

Users who are viewing this thread

Top Bottom