Divide by zero in formula

G

Guest

My report has a control which shows a percentage calcultion. The control has
its control source set to =[Col1]/([Col2]-[Col3]). When the figures are zero,
the report prints '#Num!". Is there an easy way to avoid this. Ideally I'd
like to print a blank.
 
J

Jeff Boyce

You could "do the math" in the query that underlies the report, and pre-test
for zero with an IIF() expression, something like:

IIF([Col2]-[Col3] = 0,"",[Col1]/([Col2]-[Col3])

Good luck!

Jeff Boyce
Microsoft Office/Access MVP
 

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