473,322 Members | 1,347 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Dividing by Zero.......avoid the #Num! from displaying

kcdoell
230 100+
Hello:

I have three unbound text boxes in which I have the following calculations in the control source of each box:

FCST Total; [SumGWP]
Expand|Select|Wrap|Line Numbers
  1. =Nz(DSum("[GWP]","ReQryForecast","[Binding_Percentage] >= 75"),0)
Budget Total; [TxtBudGWP]
Expand|Select|Wrap|Line Numbers
  1. =Nz(DSum("[SumOfGWP]","QryBudget_Sum"),0)
FCST vs. Budget; [FCSTvsPrior_GWP]
Expand|Select|Wrap|Line Numbers
  1. =(Nz(Forms!Forecast!SumGWP,0)-Nz(Forms!Forecast!TxtBudGWP,0))/Nz(Forms!Forecast!TxtBudGWP,0)
My issue is that when [TxtBudGWP] is “0” I get a #Num! In my [FCSTvsPrior_GWP]. I know in one case, [FCSTvsPrior_GWP] would be doing a calculation of (0-0)/0. How can I avoid the #Num! from displaying or how can I compensate for the scenario of a calculation that is dividing by zero?

Thanks,

Keith.
May 5 '08 #1
2 2702
kcdoell
230 100+
I solved it!

Expand|Select|Wrap|Line Numbers
  1. =IIf([TxtBudGWP]=0,0,(([Forms]![Forecast]![SumGWP])-([Forms]![Forecast]![TxtBudGWP]))/([Forms]![Forecast]![TxtBudGWP]))
  2.  
Thanks,

Keith
May 5 '08 #2
NeoPa
32,556 Expert Mod 16PB
That's about the size of it Keith :)
May 5 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

65
by: Pmb | last post by:
I'm confused as to what the compiler error message I'm getting is refering to. Can someone take a gander and let me know what I did wrong? The program is below. When I compile it I get the...
33
by: Jim Cobban | last post by:
I cannot get Netscape 4.79 to properly display the ordered list in the following fragment. <P>Get a specific portion of the date. Depending upon the value of index: <ol start=0> <li>complete...
4
by: shuisheng | last post by:
Dear all, Assume I have two big arrays A and B. And I want to element-wise divide A by B. When an element of B is zero, the results are also zero. Such as A = { 2, 4, 0, 6} B = { 1, 0, 0, 2}...
16
by: Richard Maher | last post by:
Hi, I have this Applet-hosted Socket connection to my server and in an ONevent/function I am retrieving all these lovely rows from the server and inserting them into the Select-List. (The on...
8
by: Andrew Poulos | last post by:
In my limited testing with FF 2, IE 6 and Opera 9 when I divided a positive integer, that is less than 100, by 100 I get a leading zero in front of the decimal point. For example 80/100 gives...
4
by: H.S. | last post by:
Hello, I am trying out a few methods with which to test of a given number is practically zero. as an example, does the following test correctly if a given number is zero within machine...
7
by: southernsunsations | last post by:
/******************************************************************\ * * * * Date: 09.06.2007 ...
9
ollyb303
by: ollyb303 | last post by:
Hi, I have created a report in my Access db which has two columns - I'll call them Number1 and Number2. I have added a textbox to calculate a percentage from these two numbers =(/) with the...
9
by: Dhiru1009 | last post by:
Hi guys, I am trying to build a user registration form using PHP and MYSQL but encountring a problem. When I click on submit with empty fields it adds records to database also it doesn't matter...
1
by: zufie | last post by:
This is my original equation: =(/)*100 When the denomimator is zero I am unable to calculate the percentage. I tried changing my equation to this format: =IIf( = 0, 0, / ) I also tried:
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.