pdvsa
asked on
IsError
Hello, trying to display nothing or a 0 if there is a #error. What is function in Access?
=Iferror(DSum("Amount","tb lDraws_Det ails1","Dr awID1=" & [ID]),0)
thanks
=Iferror(DSum("Amount","tb
thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
IsError doesn't always catch everything, so use this instead:
Function AvoidError(n As Variant, varReplaceWith As Variant)
On Error GoTo AvoidError_Error
AvoidError = Nz(n, varReplaceWith)
AvoidError_Exit:
Exit Function
AvoidError_Error:
AvoidError = varReplaceWith
Resume AvoidError_Exit
End Function
Jim.
Function AvoidError(n As Variant, varReplaceWith As Variant)
On Error GoTo AvoidError_Error
AvoidError = Nz(n, varReplaceWith)
AvoidError_Exit:
Exit Function
AvoidError_Error:
AvoidError = varReplaceWith
Resume AvoidError_Exit
End Function
Jim.
IsError is also an Access thing :-)
Ok @mx <grin>
"IsError is an Excel thing." should have been
IsError is more of an Excel thing.
You see it most often in Excel cell formulas where you don't want (#N/A, #VALUE!, #REF!, #DIV/0!, #NUM!, #NAME? or #NULL) to show.
Access's is much more limited. It has to be a numeric expression, and basically used in conjuection with CVErr, and it is not an analog for the Excel IsError at all.
"IsError is an Excel thing." should have been
IsError is more of an Excel thing.
You see it most often in Excel cell formulas where you don't want (#N/A, #VALUE!, #REF!, #DIV/0!, #NUM!, #NAME? or #NULL) to show.
Access's is much more limited. It has to be a numeric expression, and basically used in conjuection with CVErr, and it is not an analog for the Excel IsError at all.
Well, I've used it successfully in many places. I've also used Jim's legendary AvoidError function.
But, no worries.
But, no worries.
ASKER
thank you for the explanation.