Get rid of #ERROR (1 Viewer)

AlvaroCity

Registered User.
Local time
Today, 00: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])))
 

KenHigg

Registered User
Local time
Yesterday, 20:16
Joined
Jun 9, 2004
Messages
13,327
You should trap the null values and code around them instead of the error.
 

sneuberg

AWF VIP
Local time
Yesterday, 17:16
Joined
Oct 17, 2014
Messages
3,506
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.
 

AlvaroCity

Registered User.
Local time
Today, 00:16
Joined
Jul 16, 2016
Messages
70
Re: Get rid of #ERROR [SOLVED]

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

Users who are viewing this thread

Top Bottom