Hi everyone
Please can someone help me with this problem I am having.
I have a form with a subform on it.
On the main form are two date fields - when the user enters the two dates - the subform shows any records which fall between the two dates.
One of the fields on the subform is a currency field. I have another field on the main form which totals up this currency field. All works well....
But if no records appear in the subform - my total field on the main form has '#Error'.
Here is the content of the field:
=IIf(Forms!frmInvoices!subTaxiChangesForInvoices!TCCalc=Null,0,Forms!frmInvoices!subTaxiChangesForInvoices!TCCalc)
What I would like it to do is display a zero if there is no records, or if there are records then show the content of the above field. I have tried replacing the NULL part above with two quotes but it doesnt work.
I created a command button with displays a msgbox of the the total field, but if I press this button when no records are displayed in the subform then I get this lovely error message:
Run Time Error 2427
You entered an expression that has no value.
I really need this to work as I use this field for another calculated field and it doesnt work if the #Error is there.
Hope this makes sense.
Many Thanks in advance.
Daz
Please can someone help me with this problem I am having.
I have a form with a subform on it.
On the main form are two date fields - when the user enters the two dates - the subform shows any records which fall between the two dates.
One of the fields on the subform is a currency field. I have another field on the main form which totals up this currency field. All works well....
But if no records appear in the subform - my total field on the main form has '#Error'.
Here is the content of the field:
=IIf(Forms!frmInvoices!subTaxiChangesForInvoices!TCCalc=Null,0,Forms!frmInvoices!subTaxiChangesForInvoices!TCCalc)
What I would like it to do is display a zero if there is no records, or if there are records then show the content of the above field. I have tried replacing the NULL part above with two quotes but it doesnt work.
I created a command button with displays a msgbox of the the total field, but if I press this button when no records are displayed in the subform then I get this lovely error message:
Run Time Error 2427
You entered an expression that has no value.
I really need this to work as I use this field for another calculated field and it doesnt work if the #Error is there.
Hope this makes sense.
Many Thanks in advance.
Daz