#ERROR in report

  • Thread starter Thread starter dayus
  • Start date Start date
D

dayus

Guest
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.
 
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
 
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
 
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.
 

Users who are viewing this thread

Back
Top Bottom