Calculation Problem

A

Anthony Viscomi

I am trying to make the following caclulation within an Unbound txtBox:

=([H_Fraction_Top]/[H_Fraction_Bottom])+[H_Inch]

My problem is that if the values for H_Fraction_Top and H_Fraction_Bottom
are 0 the #Num! is dispalyed.

What am I doing wrong?

Thanks in advance!
Anthony Viscomi
 
D

Douglas J. Steele

=IIf([H_Fraction_Bottom]=0, 0,
([H_Fraction_Top]/[H_Fraction_Bottom])+[H_Inch])

If there's a chance that the fields are actually Null, rather than 0, try:

=IIf(Nz([H_Fraction_Bottom],0)=0, 0,
(Nz([H_Fraction_Top],0)/[H_Fraction_Bottom])+Nz([H_Inch],0))
 
A

Anthony Viscomi

Thanks!
Douglas J. Steele said:
=IIf([H_Fraction_Bottom]=0, 0,
([H_Fraction_Top]/[H_Fraction_Bottom])+[H_Inch])

If there's a chance that the fields are actually Null, rather than 0, try:

=IIf(Nz([H_Fraction_Bottom],0)=0, 0,
(Nz([H_Fraction_Top],0)/[H_Fraction_Bottom])+Nz([H_Inch],0))

--
Doug Steele, Microsoft Access MVP

(No private e-mails, please)


Anthony Viscomi said:
I am trying to make the following caclulation within an Unbound txtBox:

=([H_Fraction_Top]/[H_Fraction_Bottom])+[H_Inch]

My problem is that if the values for H_Fraction_Top and H_Fraction_Bottom
are 0 the #Num! is dispalyed.

What am I doing wrong?

Thanks in advance!
Anthony Viscomi
 

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

Similar Threads

Percent format 2
HP 3000 Date Conversion 5
Linked Table Error 1
DSum Problem 2
Extracting a value from a string 3
Do Menu Item 2
Help with assignment of values to controls on report 6
Fill fields automatically 1

Top