434,847 Members | 2,285 Online + Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,847 IT Pros & Developers. It's quick & easy.

Getting around #Num!

 P: n/a One of the calculated controls on my form often divides by 0 thus giving the #Num! error in the control. Is there a way I can write my calculation to avoid this, i.e. display 0 if this occurs? I tried using =IIf(IsError(Calculation),0,Calculation) but no dice. (The calculation/IIf statement is the Control Source for the control, not done through vba) Feb 12 '07 #1
3 Replies

 P: n/a How about: IIF( Nz(Divisor,0)=0,0,Calculation) Jimmy wrote: >One of the calculated controls on my form often divides by 0 thus giving the#Num! error in the control. Is there a way I can write my calculation toavoid this, i.e. display 0 if this occurs? I tried using=IIf(IsError(Calculation),0,Calculation) but no dice. (The calculation/IIfstatement is the Control Source for the control, not done through vba) -- HTH - RuralGuy (RG for short) acXP WinXP Pro Please post back to this forum so all may benefit. Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...ccess/200702/1 Feb 12 '07 #2

 P: n/a On Mon, 12 Feb 2007 16:34:09 GMT, Jimmy wrote: One of the calculated controls on my form often divides by 0 thus giving the #Num! error in the control. Is there a way I can write my calculation to avoid this, i.e. display 0 if this occurs? I tried using =IIf(IsError(Calculation),0,Calculation) but no dice. (The calculation/IIf statement is the Control Source for the control, not done through vba) Test if the divisor's value is 0 first: =IIf([SomeField]=0,0,[AField]/[SomeField]) -- Fred Please respond only to this newsgroup. I do not reply to personal e-mail Feb 12 '07 #3

 P: n/a "Jimmy"

This discussion thread is closed

Replies have been disabled for this discussion. 