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
|
|||
|
|||
SUM Calculation in Mainform from data in Subform
I have a form where the sum of a particular datasheet view field must be
shown. Essentially it is a time tracking form where each step is recorded in the amount of time allotted and used. Both are seperate fields in the subform. The main form has three boxes for the information based on the calculations that need to be incorporated into the table for later queries and data analysis. Subform.Field1 and Subform.Field2 both need a SUM calculation made and displayed in Mainform.Field1 and Mainform.Field2, respectively. Mainform.Field3 is the variation in the two (allotted vs. actual). All three Mainform Fields must be able to go into a table (again, for later use in queries and data analysis). Is there any way that this can be accomplished. So far I have had no luck in getting the data to save to the table associated with the Mainform. Rattler0812 |
#2
|
|||
|
|||
SUM Calculation in Mainform from data in Subform
Rattler,
Given that you have captured all the data needed to make the subform calculations (1, 2, and 3) in the subform, you would NOT want to save those values in table. Never save values that can be derived from data you already have saved. As an simple example... if you captured Price and Qty, you would not save the LineTotal for that transaction (LineTotal = Price * Qty)... only "display" the calculated value, as needed. These "calculated" values can always be re-derived "on the fly", from the existing table values, in any subsequent form, query, or report. If you must "save" the 3 calc'ed values, you'll have to create table fields to retain those values in your subform table. Using my simple example above, with a table field named [LineTotal], On the AfterUpdate of either Price OR Qty... LineTotal = Price * Qty In each of your 3 calcs, do the same in the AfterUpdate of any "element" involved in that calculation. -- hth Al Campagna Candia Computer Consulting - Candia NH http://home.comcast.net/~cccsolutions "Find a job that you love, and you'll never work a day in your life." "rattler0812" wrote in message ... I have a form where the sum of a particular datasheet view field must be shown. Essentially it is a time tracking form where each step is recorded in the amount of time allotted and used. Both are seperate fields in the subform. The main form has three boxes for the information based on the calculations that need to be incorporated into the table for later queries and data analysis. Subform.Field1 and Subform.Field2 both need a SUM calculation made and displayed in Mainform.Field1 and Mainform.Field2, respectively. Mainform.Field3 is the variation in the two (allotted vs. actual). All three Mainform Fields must be able to go into a table (again, for later use in queries and data analysis). Is there any way that this can be accomplished. So far I have had no luck in getting the data to save to the table associated with the Mainform. Rattler0812 |
#3
|
|||
|
|||
SUM Calculation in Mainform from data in Subform
THANK YOU SO MUCH!!! While I understand your counsel to not save the data to
a table, it was not my decision to add that in. But, that is what I was looking for so that my boss will be happy. Thank you again. Rattler "Al Campagna" wrote: Rattler, Given that you have captured all the data needed to make the subform calculations (1, 2, and 3) in the subform, you would NOT want to save those values in table. Never save values that can be derived from data you already have saved. As an simple example... if you captured Price and Qty, you would not save the LineTotal for that transaction (LineTotal = Price * Qty)... only "display" the calculated value, as needed. These "calculated" values can always be re-derived "on the fly", from the existing table values, in any subsequent form, query, or report. If you must "save" the 3 calc'ed values, you'll have to create table fields to retain those values in your subform table. Using my simple example above, with a table field named [LineTotal], On the AfterUpdate of either Price OR Qty... LineTotal = Price * Qty In each of your 3 calcs, do the same in the AfterUpdate of any "element" involved in that calculation. -- hth Al Campagna Candia Computer Consulting - Candia NH http://home.comcast.net/~cccsolutions "Find a job that you love, and you'll never work a day in your life." "rattler0812" wrote in message ... I have a form where the sum of a particular datasheet view field must be shown. Essentially it is a time tracking form where each step is recorded in the amount of time allotted and used. Both are seperate fields in the subform. The main form has three boxes for the information based on the calculations that need to be incorporated into the table for later queries and data analysis. Subform.Field1 and Subform.Field2 both need a SUM calculation made and displayed in Mainform.Field1 and Mainform.Field2, respectively. Mainform.Field3 is the variation in the two (allotted vs. actual). All three Mainform Fields must be able to go into a table (again, for later use in queries and data analysis). Is there any way that this can be accomplished. So far I have had no luck in getting the data to save to the table associated with the Mainform. Rattler0812 |
Thread Tools | |
Display Modes | |
|
|