Re: #Num!

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



This works! after I changed the textbox names to txtAmount and txtUnitPrice.
thank you very much. Seeing #Num! in a calculated field for new records has
bugged me for a long time.
Claudette Hennessy
"Wayne Morgan" <comprev_gothroughthenewsgroup@xxxxxxxxxxx> wrote in message
news:euE4eMjYFHA.3840@xxxxxxxxxxxxxxxxxxxxxxx
> =Nz(IIf([UnitPrice]=0, 0, [Amount]/[UnitPrice]), 0)
>
> You can't divide by 0 without getting an error, but with either value
> Null, the result will be Null. The IIf solves the divide by zero problem,
> then the Nz handles the Null result.
>
> --
> Wayne Morgan
> MS Access MVP
>
>
> "Claudette Hennessy" <chennessy@xxxxxxxxxxx> wrote in message
> news:eJwUo6iYFHA.3364@xxxxxxxxxxxxxxxxxxxxxxx
>> For instance, a calculated field is set to [Amount]/[UnitPrice]. This
>> results in #Num! on some records. Am looking for an expression that
>> results in 0 if either [Amount] or [Unit Price] is null.
>> Claudette Hennessy
>>
>
>


.



Relevant Pages

  • Re: #Num!
    ... The IIf solves the divide by zero problem, ... >> results in #Num! ... >> Claudette Hennessy ... Prev by Date: ...
    (microsoft.public.access.forms)
  • RE: #Num! division with IIf statements
    ... you will get a divide by zero error by specifyin 0 and the False ... In reality it's not divided by zero, these are nulls divided by nulls. ... particular date-range that's where I get the #Num! ...
    (microsoft.public.access.reports)
  • RE: #Num! Error
    ... I can't figure if you are getting divide by zero issues or nulls. ... to count in the fields in question I get a #Num! ... "Duane Hookom" wrote: ...
    (microsoft.public.access.reports)
  • RE: #Num! division with IIf statements
    ... Actually, as written, you can very possibly get a divide by zero. ... In reality it's not divided by zero, these are nulls divided by nulls. ... particular date-range that's where I get the #Num! ...
    (microsoft.public.access.reports)
  • Re: #Num!
    ... > so we'll use the iif for the second value and the nz for the first value. ... >> results in #Num! ... >> Claudette Hennessy ... Prev by Date: ...
    (microsoft.public.access.forms)