Get rid of #ERROR

AlvaroCity

Registered User.
Local time
Today, 09:16
Joined
Jul 16, 2016
Messages
70
hello everyone.

Working on my database I bumped into this problem

On my form I using some Dsum funtions to add some figures from the form, but when I'm going to introduce new data into the form, this fields are obviously empty and returns #ERROR and I would like to get rid of it.

I have been checking online and I saw the funtion "IsError" so I tried the next code. but this still returns #ERROR for some reason although when there is not error this surprisingly works fine. :banghead:

Code:
=IIf(IsError(FormatCurrency(DSum("TotalAlbaran","qrySubFactura","[FacturaID]=" & [FacturaID]))),"Blank",FormatCurrency(DSum("TotalAlbaran","qrySubFactura","[FacturaID]=" & [FacturaID])))
 
You should trap the null values and code around them instead of the error.
 
Expanding on KenHigg's comment if FacturalID being null is the problem then I suggest trying

Code:
=IIf(IsNull([FacturaID]), "Blank", FormatCurrency(DSum("TotalAlbaran", "qrySubFactura", "[FacturaID]=" & [FacturaID])))

This might not work as both the true and false expressions of the IIF function are stupidly executed whether or not they need to be but in some cases this seem to stop the error.

I've never been able to get IsError to do anything useful for me. I wonder when it is supposed to work.
 
Re: Get rid of #ERROR [SOLVED]

Thank you very much!! It worked perfectly!! you saved me this time!:):):)
 

Users who are viewing this thread

Back
Top Bottom