#Error in Report help

denileigh

Registered User.
Local time
Today, 03:10
Joined
Dec 9, 2003
Messages
212
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?
 
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"
 
Okay i found solution to part of my problem:

Code:
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:

Code:
=NullToZero([inputdate]).


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

I currently have:
Code:
=Format$([InputDate],"Long Date",0,0)
but i want the
Code:
=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?
 

Users who are viewing this thread

Back
Top Bottom