Error# 0

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

Guest

Can someone tell me why this might be happening? Using Access 2003.

I have a calculated field that calls a custom function. The function
recieves a Long Integer (from a datediff calc) and returns a string that
displays duration in time (hh:nn:ss). As I was testing various invalid user
inputs I received an "Overflow" error. I put error handling (none before
this) in the function to trap the overflop error. Then I started getting a 0
error even though there was no error. I've trapped that so it is working
fine but I have had to do this on many functions. Is this a normal behavior
when putting error handling in functions?

Thanks for any insight to this matter.
LeAnn
 
Error 0 means "no error", so you don't need to trap for that unless you're
testing to be sure there's no error.

The overflow error that you're getting likely is caused by ACCESS or Jet not
being able to recognize an input as a date, and instead is interpreting it
as a division expression; and that the result of that is not a result that
fits within the data type contstraints.

You'll need to give us more info about the specific data input that causes
the overflow error, and the function programming, etc., so that we can see
what is happening.
 
Thanks Ken. The overflow occurred I'm assuming because the value passed to
the function was too large. The calculated field on my form takes the
difference between 2 other date fields (in seconds) and passes that to the
custom function. I used dates 12 years apart so I'm ok with trapping for
that error.

I just realized that I forgot to put my Exit code above the error handler.
Duh!

Your answer triggered my realization - thanks!
 
LeAnn said:
I just realized that I forgot to put my Exit code above the error handler.
Duh!

Your answer triggered my realization - thanks!

It's my secret how many times I've done that < g >....
 

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

Similar Threads


Back
Top