Best approach would be to understand why it returns #Error.
Could it be a "Division by zero" error, if you are dividing one field by
another?
Is this a calculated field, with a function call that has bad arguments?
For example, if you use:
DLookup("MyField", "MyTable", "SomeField = " & [XXX])
and XXX is null, the 3rd argument is malformed. Or if you use:
DateSerial(Year(Date()), Month([DOB]), Day([DOB]))
where DOB is null, the assignment fails.
It is possible to work around the error with IsError() and IIf(), but it
would be instructive to figure out what's causing it.
--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Reply to group, rather than allenbrowne at mvps dot org.
Randal said:
How can I get a query to return "0" instead of "#Error"?