I'm in Northwest Alberta, Canada (MST) Mountain Standard time.
[TotalPayment] is a text block (and name) in each separate form/subform. It totals the full value of that form (i.e. -Master Card Payment)
=sum([Payments]) called "TotalPayment"
the results of this is either a number value (or) completely blank if there are no records.
there are 4 forms almost identical, except one totals Cash Payments, one totals Visa Payments, one for Interac, and of course one for Master card.
These 4 forms are put into the main form as subforms
Subform#1- Daily WO Query-mastercard is the name of the subform; TotalPayment is the name of the text block that has the =sum([Payments]) The sum of all the master card payments.
Subform#2- Daily WO Query-visa is the name of the subform; TotalPayment is the name of the text block that has the =sum([Payments]) The sum of all the visa payments.)
Subform#3- Daily WO Query-cash is the name of the subform; TotalPayment is the name of the text block that has the =sum([Payments]) The sum of all the cash payments.)
Subform#4- Daily WO Query-debt is the name of the subform; TotalPayment is the name of the text block that has the =sum([Payments]) The sum of all the debt payments.)
~~~~~~~~~~~~
The Main Form has the calendar control and the 4 subforms (only showing the final totals).
The text blocks we are trying to work on is the 4 text blocks in the main form (called cash, visa, mc, and debt - not that it matters of their names) that go and retrieve the Number value from the "TotalPayment" text blocks from these 4 subforms.
I originally has the code as in these 4 main form text blocks as (except each was linked to the correct form, I am only showing one here):
nz([Daily WO Query-mastercard].[Form]![TotalPayment])
and
IIf([Daily WO Query-mastercard].[Form]![TotalPayment],([Daily WO Query-mastercard].[Form]![TotalPayment]),"0")
both codes gives me an error if no value, or the correct value if there is a number value
and I also tried
nz([Daily WO Query-mastercard].[Form]![TotalPayment],0,"") gives me a blank
IIf([Daily WO Query-mastercard].[Form]![TotalPayment],"0","") This code gives me a Zero but if there is data available, it still shows a zero
the '#error' was because there is no number value - it is completely blank) unless it had an actual number value in which case it showed that number value (i.e. 25.00). so, to clarify: i got either $25.00 or #error
Once again, the code listed below works but crashes MS Access (i.e. it gives me either a zero or the proper value then after a few date changes, it crashes):
=IIf(IsError([Daily WO Query-mastercard].[Form]![TotalPayment]),0,([Daily WO Query-mastercard].[Form]![TotalPayment]))
I sure hope this clarifies it better for you as I don't know if i could get any more specific.
The last code you gave me to try just gave me a zero all the time