catching #error on calculated control

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a Dsum field (NZ) which, before anything is entered shows #error and
the debugger comes up. As soon as I enter a row, it does go to zero. How can
I trap the original #error and skip it? I have tried checking for null, even
checking for = #error, but no luck.

How can I trap and skip over this?

tia.

HB
 
Where have you defined the DSum field, in the Control Source of the textbox?
If so, you may be able to use an IIF statement to check for a value in one
of the other controls prior to calculating the DSum.

Example:
IIf(Not IsNull(txtMyTextbox), DSum(....))
 
Yes, they are all in the control source. And yes, your ideal worked ! Thanks.
why isn;t the NZ(DSUM) catching the null and putting it to zero? It seems
putting in that IIF is what the NZ should be doing.

Brillant idea, thanks again.
 
The reason Nz(DSum()) isn't working is because the DSum is run first, then
the Nz. DSum is returning the error, not a Null value, so there isn't
anything for Nz to do.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top