#Error in Report

mugman17

Registered User.
Local time
Today, 23:00
Joined
Nov 17, 2000
Messages
110
I have a report that is generated based on several subforms and subqueries. If there is no data for one of the queries, all the text boxes that relate to that query give me a #error.

Is there a way to change these to zero? I tried the code below, and it did not work.

Function nnz(testvalue As Variant) As Variant
'Not Numeric return zero
If Not (IsNumeric(testvalue)) Then
nnz = 0
Else
nnz = testvalue
End If
End Function


Thanks in advance.
 
I would use the IsError function to test if the calulation equals an error.
 
Use the HasData method, examples have been posted here
 

Users who are viewing this thread

Back
Top Bottom