Re: #Error

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Allen Browne (AllenBrowne_at_SeeSig.Invalid)
Date: 05/10/04


Date: Mon, 10 May 2004 21:48:38 +0800

You have a simple choice: correct the formula, or put up with the error.

It is not difficult to fix, e.g.:
    =IIf([denom] = 0, 0, [num] / denom])

-- 
Allen Browne - Microsoft MVP.  Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
"Randal" <rlwnrAThighstream.net> wrote in message
news:el%23BQooNEHA.3012@tk2msftngp13.phx.gbl...
> Thanks. It is division by 0.  But, I don't want to change the formula
> because it works in 99% of the cases.
>
> "Allen Browne" <AllenBrowne@SeeSig.Invalid> wrote in message
> news:409bc23d$0$16585$5a62ac22@freenews.iinet.net.au...
> > Best approach would be to understand why it returns #Error.
> >
> > Could it be a "Division by zero" error, if you are dividing one field by
> > another?
> >
> > Is this a calculated field, with a function call that has bad arguments?
> > For example, if you use:
> >     DLookup("MyField", "MyTable", "SomeField = " & [XXX])
> > and XXX is null, the 3rd argument is malformed. Or if you use:
> >     DateSerial(Year(Date()), Month([DOB]), Day([DOB]))
> > where DOB is null, the assignment fails.
> >
> > It is possible to work around the error with IsError() and IIf(), but it
> > would be instructive to figure out what's causing it.
> >
> > "Randal" <rlwnrAThighstream.net> wrote in message
> > news:uoKI8vENEHA.3312@tk2msftngp13.phx.gbl...
> > > How can I get a query to return "0" instead of "#Error"?


Relevant Pages

  • Re: Syntax for using Nz function to handle blank fields in a query calculation
    ... You could verify that by omitting the calculated field, ... Allen Browne - Microsoft MVP. ...
    (comp.databases.ms-access)
  • Re: Sum Query Incorrect
    ... Is it a calculated field in a query? ... Something in the expression is causing Access to treat it as text. ... You can probably verify that by opening that query, and seeing if JET left-aligns the column or right-aligns it ... Allen Browne - Microsoft MVP. ...
    (microsoft.public.access.queries)
  • Re: Calculating dates..
    ... I cant change the record source of the form, I need it set to the table it ... > You need to put that into the query that feeds the form. ... > set the Control Source of the text box to the name of the calculated field ... > Allen Browne - Microsoft MVP. ...
    (microsoft.public.access.reports)
  • Re: Access2000 report isnt running correctly in Access2003
    ... Office 2003, which includes the fix. ... Allen Browne - Microsoft MVP. ... Perth, Western Australia. ...
    (microsoft.public.access.reports)
  • Re: Excluding empty fields from a concatenated string
    ... > You could try putting the calculated field into your query, ... > represented by a control on the report. ... > Allen Browne - Microsoft MVP. ...
    (microsoft.public.access.queries)