Link to home
Start Free TrialLog in
Avatar of Taras
TarasFlag for Canada

asked on

Subform Total shows #Error

In MS Access 2010 I have Main form frmMain and subform frmSubMain.
Both forms are not bound forms.
On subform  frmSubMain I have a  several fields one of them is field : “Amount”  this field  I want to summarize.

 All fields on subform showing proper values and that is ok and I can see  Amounts value too .
I put in subform frmSubMain footer  text field txtTotAmount and  formatted it as currency and here I went through Expression Builder and find the field Amount in subform  frmSubMain and put it in, so in field I have : =Sum([Amount]).
It worked before, and I was getting proper amount total value,  I do not remember changing something,  but now I am getting in the txtTotAmount  field value    “ #error “ I tried with  =NZ(Sum(Amount)) but it not worked.
Avatar of Dale Fye
Dale Fye
Flag of United States of America image

If you want to a control to display a sum, you need to:

1.  use the DSUM( ) domain function to define what column you want to sum, from which table, and under what criteria.

2.  in a bound, continuous form, you could put a control in the footer (txt_SumAmount) of the form and set its control source to:

= SUM([Amount])

If you want to display this sum on the main form, you would hide the footer of the subform, and set the ControlSource of the control on the main form to something like:

= Forms!MainFormName.subFormControlName.Form.txt_SumAmount
ASKER CERTIFIED SOLUTION
Avatar of Taras
Taras
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Taras

ASKER

Thanks a lot.