Expression Build on Form Needs If Then Statement

  • Thread starter Thread starter LDMueller
  • Start date Start date
L

LDMueller

In Access 2003 I need to make the formula for the Expression Builder to be
the equivalent of the following:

If [Efficiency] <> 0 then ([WghtCalc]*[Efficiency])

Can anyone help me with this.

Thanks!

LDMueller
 
I'd think that should be

IIf(Nz([efficiency], 0) <> 0,[WghtCalc]*[Efficiency], 0)

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


bhicks11 via AccessMonster.com said:
iif(not isnull[efficiency],([WghtCalc]*[Efficiency]))

Bonnie
http://www.dataplus-svc.com
In Access 2003 I need to make the formula for the Expression Builder to be
the equivalent of the following:

If [Efficiency] <> 0 then ([WghtCalc]*[Efficiency])

Can anyone help me with this.

Thanks!

LDMueller
 
On thinking about this more, the ", 0" at the end probably isn't what's
required, since you'd be able to use a simple

[WghtCalc]*Nz([Efficiency],0)

if it were!

LD: you'll have to decide what value you want if Efficiency is 0, and plug
it in there.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Douglas J. Steele said:
I'd think that should be

IIf(Nz([efficiency], 0) <> 0,[WghtCalc]*[Efficiency], 0)

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


bhicks11 via AccessMonster.com said:
iif(not isnull[efficiency],([WghtCalc]*[Efficiency]))

Bonnie
http://www.dataplus-svc.com
In Access 2003 I need to make the formula for the Expression Builder to
be
the equivalent of the following:

If [Efficiency] <> 0 then ([WghtCalc]*[Efficiency])

Can anyone help me with this.

Thanks!

LDMueller
 
Thank you for your prompt response. I guess I should have been more clear
with my question.

The <> (e.g. not = part) is zero, not null or empty. The fields is zero and
when it's zero I don't want it to take the ([WghtCalc]*[Efficiency]).

Does this make more sense?

Thanks!


bhicks11 via AccessMonster.com said:
iif(not isnull[efficiency],([WghtCalc]*[Efficiency]))

Bonnie
http://www.dataplus-svc.com
In Access 2003 I need to make the formula for the Expression Builder to be
the equivalent of the following:

If [Efficiency] <> 0 then ([WghtCalc]*[Efficiency])

Can anyone help me with this.

Thanks!

LDMueller
 
This was exactly what I needed. Thank you so much!

LDMueller

Douglas J. Steele said:
On thinking about this more, the ", 0" at the end probably isn't what's
required, since you'd be able to use a simple

[WghtCalc]*Nz([Efficiency],0)

if it were!

LD: you'll have to decide what value you want if Efficiency is 0, and plug
it in there.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Douglas J. Steele said:
I'd think that should be

IIf(Nz([efficiency], 0) <> 0,[WghtCalc]*[Efficiency], 0)

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


bhicks11 via AccessMonster.com said:
iif(not isnull[efficiency],([WghtCalc]*[Efficiency]))

Bonnie
http://www.dataplus-svc.com

LDMueller wrote:
In Access 2003 I need to make the formula for the Expression Builder to
be
the equivalent of the following:

If [Efficiency] <> 0 then ([WghtCalc]*[Efficiency])

Can anyone help me with this.

Thanks!

LDMueller
 
Back
Top