If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Continuous Forms - Sum of Values
I have a continuous sub form that uses a query that totals various aspects of
the business against departments. I can present each field(cloumn) individually no problems and it displays as expected.What I would like to do is sum accross columns from the ControlSource Thus I would like a Textbox in my form to display the Sumof Column A, Column B and Column C I have tried seting the control source to =SUM(ColumnA+ColumnB+ColumnC) which produces an error condition. Any thoughts would be greatfully appreciated -- Many Thanks Alan |
#2
|
|||
|
|||
Continuous Forms - Sum of Values
Alan,
You shouldn't be summing the column name, you should be summing the field in that column. Given an example like an inventory balance with these 3 example fields... PartNo Received Disbursed 123 10 123 5 123 7 123 4 The Received sum would be... =Sum(Received) The Disbursed sum would be... =Sum(Disbursed) The Balance would be... =Sum(Received) - Sum(Disbursed) -- hth Al Campagna Microsoft Access MVP http://home.comcast.net/~cccsolutions/index.html "Find a job that you love... and you'll never work a day in your life." "Alan" wrote in message ... I have a continuous sub form that uses a query that totals various aspects of the business against departments. I can present each field(cloumn) individually no problems and it displays as expected.What I would like to do is sum accross columns from the ControlSource Thus I would like a Textbox in my form to display the Sumof Column A, Column B and Column C I have tried seting the control source to =SUM(ColumnA+ColumnB+ColumnC) which produces an error condition. Any thoughts would be greatfully appreciated -- Many Thanks Alan |
#3
|
|||
|
|||
Continuous Forms - Sum of Values
Al
Thanks for the reply. I have tried this, however simply get the #error returned I have my dept sale grouped into five depts and on a continuous form thus is displayed on the main form as Department Name SalesA SalesB SalesC Dept1 5 2 4 Dept1 3 4 7 Dept3 1 6 2 Another column in the controlsource is sales D and I would like to display as above but with sales C being a result of the addition of salesC+ SalesD ?? I hope that makes sense as that does not work for me Do you have any other suggestions ?? -- Many Thanks Alan "Al Campagna" wrote: Alan, You shouldn't be summing the column name, you should be summing the field in that column. Given an example like an inventory balance with these 3 example fields... PartNo Received Disbursed 123 10 123 5 123 7 123 4 The Received sum would be... =Sum(Received) The Disbursed sum would be... =Sum(Disbursed) The Balance would be... =Sum(Received) - Sum(Disbursed) -- hth Al Campagna Microsoft Access MVP http://home.comcast.net/~cccsolutions/index.html "Find a job that you love... and you'll never work a day in your life." "Alan" wrote in message ... I have a continuous sub form that uses a query that totals various aspects of the business against departments. I can present each field(cloumn) individually no problems and it displays as expected.What I would like to do is sum accross columns from the ControlSource Thus I would like a Textbox in my form to display the Sumof Column A, Column B and Column C I have tried seting the control source to =SUM(ColumnA+ColumnB+ColumnC) which produces an error condition. Any thoughts would be greatfully appreciated -- Many Thanks Alan |
#4
|
|||
|
|||
Continuous Forms - Sum of Values
In the query that the continuous form is based on, add another field and do
the calcuation there. It would look like this.. Total: SalesC + SalesD Then just add the field to your continous form. That is the correct way to add from left to right. If you wanted to total all of SalesA, in your continuous forms footer, you would put an unbound field, then add this to the defualt value of that field. =Sum([SalesA]) This is the correct way to add the values in your columns. -- Please remember to mark this post as answered if this solves your problem. "Alan" wrote: Al Thanks for the reply. I have tried this, however simply get the #error returned I have my dept sale grouped into five depts and on a continuous form thus is displayed on the main form as Department Name SalesA SalesB SalesC Dept1 5 2 4 Dept1 3 4 7 Dept3 1 6 2 Another column in the controlsource is sales D and I would like to display as above but with sales C being a result of the addition of salesC+ SalesD ?? I hope that makes sense as that does not work for me Do you have any other suggestions ?? -- Many Thanks Alan "Al Campagna" wrote: Alan, You shouldn't be summing the column name, you should be summing the field in that column. Given an example like an inventory balance with these 3 example fields... PartNo Received Disbursed 123 10 123 5 123 7 123 4 The Received sum would be... =Sum(Received) The Disbursed sum would be... =Sum(Disbursed) The Balance would be... =Sum(Received) - Sum(Disbursed) -- hth Al Campagna Microsoft Access MVP http://home.comcast.net/~cccsolutions/index.html "Find a job that you love... and you'll never work a day in your life." "Alan" wrote in message ... I have a continuous sub form that uses a query that totals various aspects of the business against departments. I can present each field(cloumn) individually no problems and it displays as expected.What I would like to do is sum accross columns from the ControlSource Thus I would like a Textbox in my form to display the Sumof Column A, Column B and Column C I have tried seting the control source to =SUM(ColumnA+ColumnB+ColumnC) which produces an error condition. Any thoughts would be greatfully appreciated -- Many Thanks Alan |
#5
|
|||
|
|||
Continuous Forms - Sum of Values
Alan,
Giving us examples helps a lot. But, if you have trouble with your code, please include that in your post. (Cut & Paste exactly) For example, what is the Name of the field that sums SalesA, and what is the ControlSource. Are SalesA, B, and C calculated fields on your form? -- hth Al Campagna Microsoft Access MVP http://home.comcast.net/~cccsolutions/index.html "Find a job that you love... and you'll never work a day in your life." "Alan" wrote in message ... Al Thanks for the reply. I have tried this, however simply get the #error returned I have my dept sale grouped into five depts and on a continuous form thus is displayed on the main form as Department Name SalesA SalesB SalesC Dept1 5 2 4 Dept1 3 4 7 Dept3 1 6 2 Another column in the controlsource is sales D and I would like to display as above but with sales C being a result of the addition of salesC+ SalesD ?? I hope that makes sense as that does not work for me Do you have any other suggestions ?? -- Many Thanks Alan "Al Campagna" wrote: Alan, You shouldn't be summing the column name, you should be summing the field in that column. Given an example like an inventory balance with these 3 example fields... PartNo Received Disbursed 123 10 123 5 123 7 123 4 The Received sum would be... =Sum(Received) The Disbursed sum would be... =Sum(Disbursed) The Balance would be... =Sum(Received) - Sum(Disbursed) -- hth Al Campagna Microsoft Access MVP http://home.comcast.net/~cccsolutions/index.html "Find a job that you love... and you'll never work a day in your life." "Alan" wrote in message ... I have a continuous sub form that uses a query that totals various aspects of the business against departments. I can present each field(cloumn) individually no problems and it displays as expected.What I would like to do is sum accross columns from the ControlSource Thus I would like a Textbox in my form to display the Sumof Column A, Column B and Column C I have tried seting the control source to =SUM(ColumnA+ColumnB+ColumnC) which produces an error condition. Any thoughts would be greatfully appreciated -- Many Thanks Alan |
#6
|
|||
|
|||
Continuous Forms - Sum of Values
Al
Sorry I am using a simple select query as ateh control source for the subform and then selecting the query values. I believe Garys post may be the simplest option and have it working Thanks for all your help -- Many Thanks Alan "Al Campagna" wrote: Alan, Giving us examples helps a lot. But, if you have trouble with your code, please include that in your post. (Cut & Paste exactly) For example, what is the Name of the field that sums SalesA, and what is the ControlSource. Are SalesA, B, and C calculated fields on your form? -- hth Al Campagna Microsoft Access MVP http://home.comcast.net/~cccsolutions/index.html "Find a job that you love... and you'll never work a day in your life." "Alan" wrote in message ... Al Thanks for the reply. I have tried this, however simply get the #error returned I have my dept sale grouped into five depts and on a continuous form thus is displayed on the main form as Department Name SalesA SalesB SalesC Dept1 5 2 4 Dept1 3 4 7 Dept3 1 6 2 Another column in the controlsource is sales D and I would like to display as above but with sales C being a result of the addition of salesC+ SalesD ?? I hope that makes sense as that does not work for me Do you have any other suggestions ?? -- Many Thanks Alan "Al Campagna" wrote: Alan, You shouldn't be summing the column name, you should be summing the field in that column. Given an example like an inventory balance with these 3 example fields... PartNo Received Disbursed 123 10 123 5 123 7 123 4 The Received sum would be... =Sum(Received) The Disbursed sum would be... =Sum(Disbursed) The Balance would be... =Sum(Received) - Sum(Disbursed) -- hth Al Campagna Microsoft Access MVP http://home.comcast.net/~cccsolutions/index.html "Find a job that you love... and you'll never work a day in your life." "Alan" wrote in message ... I have a continuous sub form that uses a query that totals various aspects of the business against departments. I can present each field(cloumn) individually no problems and it displays as expected.What I would like to do is sum accross columns from the ControlSource Thus I would like a Textbox in my form to display the Sumof Column A, Column B and Column C I have tried seting the control source to =SUM(ColumnA+ColumnB+ColumnC) which produces an error condition. Any thoughts would be greatfully appreciated -- Many Thanks Alan |
Thread Tools | |
Display Modes | |
|
|