Creating a Sum (1 Viewer)

torontoguy

Registered User.
Local time
Today, 12:29
Joined
Jan 7, 2009
Messages
23
I'm trying to figure out a way to create a button that will be clicked to sum up numbers in 3 other columns

eg.

id #1 #2 #3 Total#
1 5 3 2 10

does anyone know how i can macro this or is there a better way for this to be done?
 

namliam

The Mailman - AWF VIP
Local time
Today, 17:29
Joined
Aug 11, 2003
Messages
11,696
Just use the plus?

#1 + #2 + #3
 

torontoguy

Registered User.
Local time
Today, 12:29
Joined
Jan 7, 2009
Messages
23
all of my rows have a value for number 1, number 2, and number 3

and these values are able to change

i'm trying to figure out a command that adds it up somehow and i dont believe using the + sign like that works
 

namliam

The Mailman - AWF VIP
Local time
Today, 17:29
Joined
Aug 11, 2003
Messages
11,696
If you use this is a query, it does.
 

torontoguy

Registered User.
Local time
Today, 12:29
Joined
Jan 7, 2009
Messages
23
hmm

i see
any way you could guide me through creating the query using ms access 2007?

let me upload the pic of my query for you



I want the Total (A+B+C) to be the total value of values A, B and C
 

namliam

The Mailman - AWF VIP
Local time
Today, 17:29
Joined
Aug 11, 2003
Messages
11,696
As this is "Mock" I will not go into my "use a naming convention"-speech
and also will withhold my "no spaces and no special characters +()*&^% etc"-speech....
But really do ... do ... do .... use a naming convention and dont dont dont use special characters ;)

In the first empty column write code like:
Total: [a] + + [c]
 

torontoguy

Registered User.
Local time
Today, 12:29
Joined
Jan 7, 2009
Messages
23
i will remember that from now on, thanks a lot



is that what you meant?
 

namliam

The Mailman - AWF VIP
Local time
Today, 17:29
Joined
Aug 11, 2003
Messages
11,696
No, I said "First empty column", not row....
 

torontoguy

Registered User.
Local time
Today, 12:29
Joined
Jan 7, 2009
Messages
23
okay, it works in the query itself



any ideas as to how i can get it to show in this table after C?



or can i show it on a form?
 

namliam

The Mailman - AWF VIP
Local time
Today, 17:29
Joined
Aug 11, 2003
Messages
11,696
NOT!

You DONT store calculated values EVER in a table NEVER EVER EVER EVER EVER do you do that !!!!

Did that make my point?? Seriously Rule #1... Dont!

You have this query and you make a form based on this query to show your totals
 

torontoguy

Registered User.
Local time
Today, 12:29
Joined
Jan 7, 2009
Messages
23
yes sir!

alright so i turned "Mock Item" into a form but that only shows the id, item #, item, A, B and C

to add the query calculation into the Mock Item form, what would I need to do
 

namliam

The Mailman - AWF VIP
Local time
Today, 17:29
Joined
Aug 11, 2003
Messages
11,696
You already have that in the query...
Save the query....
Make the form use the query.
 

torontoguy

Registered User.
Local time
Today, 12:29
Joined
Jan 7, 2009
Messages
23
that's my little problem

i cant seem to figure out how to make the form use the query

form:



query:
in post #9 posted @ 10:00 AM
 

namliam

The Mailman - AWF VIP
Local time
Today, 17:29
Joined
Aug 11, 2003
Messages
11,696
Your 10am my 4pm ;)

Access 101:
When you make your form you can choose what table or query you want to use as the datasource.... just select the query instead of the table.
 

torontoguy

Registered User.
Local time
Today, 12:29
Joined
Jan 7, 2009
Messages
23
thank you! now to edit the looks

i've got other questions about access which i'll be getting to shortly
thanks very much for the help on this topic :)
 

Users who are viewing this thread

Top Bottom