Control Source Issue

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

=IIf(IsNull([p1]),"",IIf(Val(Nz([Form]![PEN],0))<=Val(Nz([Form]![MAXPEN],0)
and Val(Nz([Form]![PEN],0))>=Val(Nz([Form]![MINPEN],0),"PASS","FAIL"))

This control source works until I add the "Val(Nz.... section. Once I add
that part I'm getting errors. Also, can this be simplified?
 
What error? [Form]![PEN], [Form]![MAXPEN], etc. don't look correct. They
should be something like Forms![FormName]![PEN], Form![FormName]![MAXPEN],
etc.

As well, you may want to use some parentheses in there, to make sure that
the comparisons get done correctly:

=IIf(IsNull([p1]),"",IIf((Val(Nz(Forms![FormName]![PEN],0))<=Val(Nz(Forms![FormName]![MAXPEN],0))
and
(Val(Nz(Forms![Form]![PEN],0))>=Val(Nz(Forms![Form]![MINPEN],0)),"PASS","FAIL"))
 

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


Back
Top