# Error on Forms and reports

J

JP Bless

Hi all,

I have textboxes in forms and reports that get values (totals) from subforms
and subreports. When there is no data in the subreports the textboxes
display # Error. How do I make the textboxes display 0.00 when there is no
data in the subforms and subreports. I have tried the following... make the
textboxes default value to 0, Val(thesubReportTextBox) and nothing worked. I
do not want to see #Error on either the the forms or reports. Please help.
Thanks in advance.
 
M

[MVP] S.Clark

Use the Nz() function in the queries that populate the report.

e.g. Nz([fieldname], 0)
 
J

JP Bless

Query? I am sorry... I have a form and subform (also a report and
subReport). The form is bound to a table. But I have a field that gets the
value of a textbox in the subform. I set the Recordsource property of the
textbox as
=[Receipts subform].Form!txtPaid

Where "Receipts subform" is the subform
And "txtPaid" is the textbox in Receipts subform
Works fine if txtPaid is not null but returns "# Error" if null
How do I modify recordsource property to be 0 if null

I have tried
=NZ([Receipts subform].Form!txtPaid,0)
and Iif(Isnull([Receipts subform].Form!txtPaid),0,[Receipts
subform].Form!txtPaid)
Doesn't work. Please help.


[MVP] S.Clark said:
Use the Nz() function in the queries that populate the report.

e.g. Nz([fieldname], 0)

--
Steve Clark, Access MVP
FMS, Inc.
www.fmsinc.com/consulting

JP Bless said:
Hi all,

I have textboxes in forms and reports that get values (totals) from
subforms
and subreports. When there is no data in the subreports the textboxes
display # Error. How do I make the textboxes display 0.00 when there is no
data in the subforms and subreports. I have tried the following... make
the
textboxes default value to 0, Val(thesubReportTextBox) and nothing worked.
I
do not want to see #Error on either the the forms or reports. Please help.
Thanks in advance.
 
Top