Re: =Abs Zero error in my code?

Tech-Archive recommends: Fix windows errors by optimizing your registry



On Wed, 27 Apr 2005 19:26:45 GMT, "Dave Elliott"
<dave@xxxxxxxxxxxxxxxxxx> wrote:

>I need this formula to show a 0 if if the values equal 0
>right now if it is > than 0 it works but not if less than 1
>then I get #num! error message
>
>
>
>
>
>
>=Abs(([Additional Sample]>0)+([Additional Sample #2]>0)+([Additional Sample
>#3]>0)+([Additional Sample #4]>0)+([Additional Sample #5]>0)+([Additional
>Sample #6]>0)+([Additional Sample #7]>0)+([Additional Sample
>#8]>0)+([Additional Sample #9]>0)+([Additional Sample #19]>0))
>

I see you've gotten a good answer to the question - but please let me
suggest a "meta-answer" to the question behind your question.

If your table has all these Additional Sample #x fields, *IT IS
INCORRECTLY STRUCTURED*.

If you have a one (something) to many (samples) relationship, you
would be much better off with *TWO* tables in a one to many
relationship; the second table, AdditionalSamples, would have a
foreign key linking it to the main table, an AdditionalSampleNo (with
values drawn from the set {1, 2, 4, 5, 6, 7, 9, 19}, based on your
example), and a value field.

You would then be able to Sum or Count the records in this table using
a simple totals query, with no folderol with IIF() functions.

John W. Vinson[MVP]
.



Relevant Pages