Corrected divide by zero errors, now no formatting of numbers

A

Allen Browne

kahaymon said:
I used the info in this help article:
http://office.microsoft.com/en-us/access/HA010550731033.aspx?pid=CL100570041033
to correct divide by zero errors, and now the properties dialog box for
that
field does not allow me to set the decimal places at all.

That article gives really bad advice, that will create the problem you
experienced.

Step 4 of the last section suggests setting the Control Source ot:
=IIf([Divisor]=0,"",[Dividend]/[Divisor])
It should be:
=IIf([Divisor]=0, Null, [Dividend]/[Divisor])

The zero-length-string option means that Access treats the results as text,
i.e. non-numeric. That's why you could not apply a numeric format.

Technically, division by zero is 'undefined', which is perfectly represented
as Null. (As a practial example, any averaging of the resultset will be
correct if you use Null, because the undefined result should now skew the
average.)

I will attempt to get the article changed for you.
 

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

Top