J
Junior
I have a subform, in which I want to calculate a running total in the
details section (similar to the way you can do so in a report).
I have copied and pasted the RunSum function into my database, but I am
still having difficulty getting it to run - probably due to syntax.
Here are the parametres from the function:
F - The form containing the previous value to
' retrieve.
' KeyName - The name of the form's unique key field.
' KeyValue - The current record's key value.
' FieldToSum - The name of the field in the previous
' record containing the value to retrieve.
' RETURNS: A running sum of the field FieldToSum.
' EXAMPLE: =RunSum(Form,"ID",[ID],"Amount")
My subform is called [Frm_FG_Subform].
I'm assuming that the form's unique key field is a record number, or
autonumber of some sort assiciated with each record - my field is
called [Num]. The key value is the same as key name? The field I wish
to sum is [OTY]. So,
RunSum([Frm_FG_Subform],"Num",[Num],"QTY") - is this correct, becasue
when I run it, I get ?NAME.
details section (similar to the way you can do so in a report).
I have copied and pasted the RunSum function into my database, but I am
still having difficulty getting it to run - probably due to syntax.
Here are the parametres from the function:
F - The form containing the previous value to
' retrieve.
' KeyName - The name of the form's unique key field.
' KeyValue - The current record's key value.
' FieldToSum - The name of the field in the previous
' record containing the value to retrieve.
' RETURNS: A running sum of the field FieldToSum.
' EXAMPLE: =RunSum(Form,"ID",[ID],"Amount")
My subform is called [Frm_FG_Subform].
I'm assuming that the form's unique key field is a record number, or
autonumber of some sort assiciated with each record - my field is
called [Num]. The key value is the same as key name? The field I wish
to sum is [OTY]. So,
RunSum([Frm_FG_Subform],"Num",[Num],"QTY") - is this correct, becasue
when I run it, I get ?NAME.