R
RJF
I have a form with a calculated total in the footer. This field is called
txt_Total_Units. The calculation for this total field is:
=Sum(Abs([Chk_Add] In (-1))*[SumOfchrg_units])
(If the checkbox is selected in the record, add that amount to the total.)
I need to reference this field in my code. Like this:
Units = [Forms]![frm_PVD]![frm_PVD_02].Form!txt_Total_Units
I may be wrong but I believe I can't use the field name in my code like
above, but instead need to reference the calculation itself.
I tried:
Units = Sum(Abs([Chk_Add] In (-1))*[SumOfchrg_units])
but when I hit return after typing the above I get the error: "Expected: )"
then when I compile I get "Syntax Error".
Can anyone shed some light on how the code is supposed to be written for
this. I am not very experienced with VB code.
Thank you,
txt_Total_Units. The calculation for this total field is:
=Sum(Abs([Chk_Add] In (-1))*[SumOfchrg_units])
(If the checkbox is selected in the record, add that amount to the total.)
I need to reference this field in my code. Like this:
Units = [Forms]![frm_PVD]![frm_PVD_02].Form!txt_Total_Units
I may be wrong but I believe I can't use the field name in my code like
above, but instead need to reference the calculation itself.
I tried:
Units = Sum(Abs([Chk_Add] In (-1))*[SumOfchrg_units])
but when I hit return after typing the above I get the error: "Expected: )"
then when I compile I get "Syntax Error".
Can anyone shed some light on how the code is supposed to be written for
this. I am not very experienced with VB code.
Thank you,