View Full Version : #Error in Report help


denileigh
07-12-2006, 09:12 AM
Hello,

I am working on an inventory valuation summary report which calculates totals based on two subreports.

All is working great for items that have usage and current purchase orders, however, if there is no value in the subreport. For example, we don't have any purchase orders for that item since we have started this new system then it is giving me an #error on the main report.

How do I correct this?

b00zer
07-13-2006, 05:20 PM
i'd like to know anser to this as well, how do i put in a custom message so that if no values found in report it will say " No Data found for this report"

b00zer
07-13-2006, 06:16 PM
Okay i found solution to part of my problem:

Create a function:
Public Function NullToZero( TheValue as Variant)

'This function converts Null to Zero

'It also converts Non Existing Data to Zero

On Error Goto NullToZero_Err



If ISNull(TheValue) then

NullToZero = 0

Else

NullToZero = TheValue

End if

Exit Function



NullToZero_Err:

'This function would only generate an error

'if the data in TheValue doesn't exist at all.

NullToZero = 0

Exit Function

End Function

then in report in the Control Source field put:

=NullToZero([inputdate]).


my problem still exists that i want to use two functions in one control source:

I currently have: =Format$([InputDate],"Long Date",0,0) but i want the =NullToZero([inputdate]). in there as well. So if it finds data it puts it in format but if there is no data it puts 0 instead of #error message. Anyone have any ideas?