Taras
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.
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.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks a lot.
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.subForm