Divide by zero

  • Thread starter Thread starter R. Choate
  • Start date Start date
R

R. Choate

I have a report that occasionally will include a textbox that has a divide
by zero error. That's OK so far. However, another user opens the same report
and if there is a div/0 error, her PC freezes and she has to ctrl+alt+delete
to get out of Access. I try to hunt down and fix any opportunity for the
error, but my question is this: With 2 PCs that are each running the same
operating system (Win2K), and the same version of Access, why does on PC go
haywire when it encounters a div/0 ? Is there a setting I'm not thinking of?
Thanks !
 
I have a report that occasionally will include a textbox that has a divide
by zero error. That's OK so far. However, another user opens the same report
and if there is a div/0 error, her PC freezes and she has to ctrl+alt+delete
to get out of Access. I try to hunt down and fix any opportunity for the
error, but my question is this: With 2 PCs that are each running the same
operating system (Win2K), and the same version of Access, why does on PC go
haywire when it encounters a div/0 ? Is there a setting I'm not thinking of?

Avoid the error before it causes a problem. If it's in a calculated control, try
this approach:

=IIF(Nz([Field2], 0) = 0, 0, [Field1]/[Field2])

The above checks to see if the divisor field is Null or zero and, if it is,
returns the value 0, otherwise, executes the division.

If the calculation is done in code, the same logic can be used to complete the
division only if the divisor is not Null or zero.
 
Believe me, if I could turn back the clock, I would. I did not build this db
and it has lots of places to look for the bad formula. I won't bore you
with the long history, but I still need to know, why does one computer
absolutely lose it and freeze up while another PC just shows an error in the
field. If you know, please tell me.

I already know how to write a formula like the one you recommended, but
thank you for trying to help.
--
RMC,CPA


Bruce M. Thompson said:
I have a report that occasionally will include a textbox that has a divide
by zero error. That's OK so far. However, another user opens the same report
and if there is a div/0 error, her PC freezes and she has to ctrl+alt+delete
to get out of Access. I try to hunt down and fix any opportunity for the
error, but my question is this: With 2 PCs that are each running the same
operating system (Win2K), and the same version of Access, why does on PC go
haywire when it encounters a div/0 ? Is there a setting I'm not thinking
of?

Avoid the error before it causes a problem. If it's in a calculated control,
try
this approach:

=IIF(Nz([Field2], 0) = 0, 0, [Field1]/[Field2])

The above checks to see if the divisor field is Null or zero and, if it is,
returns the value 0, otherwise, executes the division.

If the calculation is done in code, the same logic can be used to complete
the
division only if the divisor is not Null or zero.
 
Believe me, if I could turn back the clock, I would. I did not build this db
and it has lots of places to look for the bad formula. I won't bore you
with the long history, but I still need to know, why does one computer
absolutely lose it and freeze up while another PC just shows an error in the
field. If you know, please tell me.

Well, there are lots of places to look for the cause of application errors, too.
I couldn't begin to tell you what might be causing any one machine's particular
sensitivity to a specific application's behavior. It's possible that someone
else with an experience very similar to yours may have found a possible
explanation/solution and can post his/her findings for you. I wish I could be
more helpful in this instance.
 
SQL Server does have a server-wide setting - ArithAbort
but I dont know of an equivalent setting in Access.

I doubt the processor makes a difference - it is up to the OS/application
to catch the error. Since you say that you are using the same OS/App
the suggestion is to check that both machines have the same service packs.

HS
 
... Since you say that you are using the same OS/App
the suggestion is to check that both machines have the same service packs.

Good point that I failed to point out. :-(

See the following page at Tony Toews' web site for more information on how to
keep your machines at the same update level:

Microsoft Access Fixes, Patches and Updates
http://www.granite.ab.ca/access/msfixes.htm

Remember to maintain Jet 4.0 at SP6 or better (I'm not sure that all the issues
in SP7 have been addressed as of yet, so SP6 might be a safer level at this
time).
 
Thanks for the good info. I did find out that my original statement about
identical operating systems was incorrect. One system turned out to be
Win98, while the other was WinXP Pro. The Win98 machine was the one with the
inability to handle div/0.

Thanks again !

--
RMC,CPA


SQL Server does have a server-wide setting - ArithAbort
but I dont know of an equivalent setting in Access.

I doubt the processor makes a difference - it is up to the OS/application
to catch the error. Since you say that you are using the same OS/App
the suggestion is to check that both machines have the same service packs.

HS
 
Back
Top