View Full Version : #ERROR in report


dayus
11-03-1999, 12:34 PM
How can I eliminate #ERROR (or produce a value of 0) if a text box in a report has no value because there was no data reported by the query the text box is based on? The data is produced by using an expresion in the query, not a specify table field.

Lou
11-05-1999, 11:58 AM
By the sounds of it you are using division. Use the iif command.

=iif(x=0,0,y/x)

However, if x is a function and is a/b, then you have to rework the equation to:

=iif(a=0,0,y/(a/b))

Hope this helps. If I am not interpreting correctly, let me know.
...Lou

FHLTICIA
11-17-2006, 09:21 AM
If there is No Data on the report try adding some code to the "On No Data" event for the report, for example.

me.fldNumber.Visible=False

boblarson
11-17-2006, 09:44 AM
One other thing that can cause a control to show #Error in it. If it is a calculated control, the controls that have the fields that are being referenced in the calculation need to be named differently than the field names. Otherwise it can't figure out which you are talking about. When doing calculations on a report you need to reference the field names and not the control names.