#Error, #Div/0! in controls

J

jer

I have included controls in a form (datasheet view) that
give the result of calculations of other controls in the
form e.g. "datesold" and "dateprocessed" are 2 controls
and "elapseddays" is another controls that shows the
difference between "dateprocessed" and "datesold". The
unique key is an autonumber. The controls work fine
except that #Error or #Div/0! appear in the form. Is
there a way to hide these
TIA
jer
 
W

Wayne Morgan

They are probably showing up when the fields supplying data for the equation
are Null or the one used for the denominator is zero. The Null can be
handled with an IIF or Nz function, the divide by zero can be handled with
an IIF function.

Example:
=IIf(txtDenominator = 0, 0, txtNumerator / txtDenominator)
=IIf(IsNull(txtMyTextbox), "", txtMyTextbox + 1)
=Nz(txtMyTextbox, "")
 
J

jer

Thanks Wayne
jer
-----Original Message-----
They are probably showing up when the fields supplying data for the equation
are Null or the one used for the denominator is zero. The Null can be
handled with an IIF or Nz function, the divide by zero can be handled with
an IIF function.

Example:
=IIf(txtDenominator = 0, 0, txtNumerator / txtDenominator)
=IIf(IsNull(txtMyTextbox), "", txtMyTextbox + 1)
=Nz(txtMyTextbox, "")

--
Wayne Morgan





.
 

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